vs程序 copy 到Qt的若干错误

就nm菜的离谱,,菜归菜,还是学到一些东西

1. 首先是windows.h在qt下的使用   LIBS +=User32.LIB

2. 离谱的 dependent error  .h does not exist   

  看网上说的是.pro文件存在缓存?解决方案:瞎jb乱摁

  通过一下步骤乱搞: (1)ctrl A ctrlX  .pro文件,编译,ctrl v编译

           (2)删除相关头文件及代码的使用,重新添加并编译(傻逼操作)

3. 无法解析的外部符号 __imp_DeleteObject  等等, 解决方法

  #pragma comment(lib, "Gdi32.lib")

4.  Cmd命令无法进行直接调用   system("start C:\\Users\\00\\Desktop\\发票\\1.24-\\思巴克72.ofd");

     解决方法:使用QProcess运行cmd命令   https://blog.csdn.net/vample/article/details/78872587

  啊呸,直接打开文件搞什么逼逼赖赖

    QString fileName = "C:\\Users\\00\\Desktop\\发票\\1.24-\\思巴克72.ofd";
    QFile file(fileName);

    if (file.exists()){
    QDesktopServices::openUrl(QUrl::fromLocalFile(fileName));
    }

  

posted @ 2021-01-29 23:17  千寻slimg  阅读(128)  评论(0编辑  收藏  举报