#include QApplication#include QLabelint mainint argc char argv QApplication appargc argv; QLabel label = new QLabelh2iHelloi font color=redQt!fonth2; label-resize300100; label-show;
#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应用程序
}
原文地址: https://www.cveoy.top/t/topic/eA10 著作权归作者所有。请勿转载和采集!