最近在写一个QT应用程序,昨天准备加上程序启动界面,类型vs那种,本来很简单如下:
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QTextCodec::setCodecForTr(QTextCodec::codecForName("gb18030"));
QPixmap pixmap("init.jpg");
QSplashScreen *splash = new QSplashScreen(pixmap);
splash->show();
//显示信息
splash->showMessage("Wait...");
qApp->processEvents();//This is used to accept a click on the screen so that user can cancel the screen
QMain window;
window.setStyleSheet("* { background-color:rgb(199,147,88); padding: 7px}");
window.show();
//图片一直显示到mainWin加载完成
splash.finish(&window);
delete sp

本文介绍了如何解决Qt程序启动界面字体大小不可调的问题。通过继承QSplashScreen类并重写drawContents()函数,可以自定义启动界面的字体大小和类型,实现个性化设置。
最低0.47元/天 解锁文章
1300

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



