Explorar o código

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

seyason %!s(int64=5) %!d(string=hai) anos
pai
achega
5bc1355d29
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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);