#include // 包含Qt应用程序类的头文件 #include // 包含标签类的头文件

int main(int argc, char *argv[]) { QApplication app(argc, argv); // 创建Qt应用程序对象 QLabel *label = new QLabel("

Hello " "Qt!

"); // 创建标签对象并设置标签文本

label->resize(300,100); // 设置标签大小
label->show(); // 显示标签
return app.exec(); // 运行Qt应用程序

}

#include QApplication#include QLabelint mainint argc char argv QApplication appargc argv; QLabel label = new QLabelh2iHelloi font color=redQt!fonth2; label-resize300100; label-show;

原文地址: https://www.cveoy.top/t/topic/eA10 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录