开始学习Qt4编程,记录建立第一个Qt4程序的流程。
1. 编写cpp文件
[root@localhost helloqt]# vim helloqt.cpp
#include <QApplication> #include <QPushButton> int main(int argc, char *argv[]) { QApplication app(argc, argv); QPushButton pushButton(QObject::tr("Hello Qt!")); pushButton.show(); QObject::connect(&pushButton,SIGNAL(clicked()),&app,SLOT(quit())); return app.exec(); }
[root@localhost helloqt]# qmake -project
[root@localhost helloqt]# qmake helloqt.pro
[root@localhost helloqt]# make
[root@localhost helloqt]# ./helloqt
原文:http://blog.csdn.net/wh921021/article/details/22782359