1. Ubuntu下安装Qt集成环境 sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer 2. 编写一个简单的Qt程序 生成一个简单的窗口#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
} 3. 生成一个与平台无关的项目文件 www.linuxidc.com@ubuntu:~/MyTrain/Qt/Basic/hello$ qmake -project4. 生成makefile文件 www.linuxidc.com@ubuntu:~/MyTrain/Qt/Basic/hello$ qmake hello.pro5. 生成目标文件 www.linuxidc.com@ubuntu:~/MyTrain/Qt/Basic/hello$ make
6. 执行目标文件 www.linuxidc.com@ubuntu:~/MyTrain/Qt/Basic/hello$ ./hello7. 运行结果