最近在写一个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 splash;
return app.exec();
}
程序没有问题,但是文字大小不可调,继续查文档,发现以下函数:void QSplashScreen::drawContents ( QPainter *