//我的第一个Qt程序 留个纪念吧! #include <QtGui/QApplication> #include "qmlapplicationviewer.h" #include <QLabel> #include <QPushButton> int main(int argc, char *argv[]) { QApplication app(argc, argv); QLabel *label = new QLabel("<h2><i>Hello </i>" "<font color = blue> Qt! </font></h2>"); label->show(); QPushButton *button = new QPushButton("Quit"); QObject::connect(button, SIGNAL(clicked()), &app, SLOT(quit())); button->show(); return app.exec(); } //注意: windows下Qt工程路径不能为中文。