qmake :根据实际环境创建项目文件. pro,然后运行qmake生成相应的makefile
构建:构建是增量编译,仅编译有更改的部分
重建:就是重新编译所有的部分
如果对运行:进行了更改,请根据现有的makefile进行编译;如果在构建和重新构建过程中没有makefile,请从. pro文件等生成makefile,然后进行编译
所以运行顺序应该是:qmake-构建-运行
写一个名为hello.cpp的代码
hello.cpp代码如下
[cpp]
# include qapplication.h # includeqpushbutton.hint main (int argc,char*argv[] ) qapplicationa(argc,argv ); qushbuttonhellobtn('Helloworld!' 、0; hello BTN.resize (200,50 ); hellobtn.show (; returna.exec (; } # include qapplication.h # includeqpushbutton.hint main (int argc,char *argv[] ) qapplicationa(argc,argv ); qushbuttonHelloBTN('Helloworld!' 、0; hello BTN.resize (200,50 ); hellobtn.show (; return a.exec (; } http://www.Sina.com/(用于创建. pro文件并将所有文件编译为独立于一个平台的工程文件) () )。
默认生成的文件名为qt.pro
2qmake -project
3qmake(根据生成的makefile将文件编译为二进制可执行程序)。
可以看到生成了qt可执行程序
5执行指令:4make
参考: https://www.cn blogs.com/hbtmwangjin/articles/9023183.html