#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
return app.exec();
}
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
return app.exec();
}
本文介绍了一个简单的Qt应用程序示例,该程序创建了一个带有文本“Hello world!”的按钮,并设置了按钮的大小为100x30。通过这个例子,读者可以了解到如何使用Qt来创建GUI元素并显示它们。

1万+

被折叠的 条评论
为什么被折叠?



