#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel label("hello world");
label.show();
return app.exec();
}
采用如下命令进行编译:
g++ -I/usr/local/opt/qt/include -std=c++11 -F/usr/local/opt/qt/lib
-framework QtCore -framework QtWidgets -o helloworld main.cpp
程序运行截图
网友评论