소스 검색

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

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);