浏览代码

修改存图路径,避免权限问题造成无法保存。

seyason 5 年之前
父节点
当前提交
5bc1355d29
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      fhKeeper/formulahousekeeper/mywork/home.cpp

+ 2 - 1
fhKeeper/formulahousekeeper/mywork/home.cpp

@@ -59,8 +59,9 @@ Home::Home(QWidget *parent) :
 
 
 void Home::captureScreen() {
+    QString picPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
     QScreen *screen = QGuiApplication::primaryScreen();
-    QString filePathName = "timeManager_screencap.jpg";
+    QString filePathName = picPath + "/timeManager_screencap.jpg";
     QFile oldFile(filePathName);
     if (oldFile.exists()) {
         QImage oldImg(filePathName);