QApplication app(argc,argv);
QPushButton *button = new QPushButton("Quit",0);
QObject::connect(button,SIGNAL(clicked()),&app,SLOT(quit()));
QSplashScreen *splash = new QSplashScreen(QPixmap("splash.png"));
splash->message(QObject::tr("Test SplashScreen..."),Qt::AlignRight | Qt::AlignTop,Qt::white);
splash->show();
//有问题的定时器
//QTimer *timer;
//QObject::connect(timer,SIGNAL(timeout()),button,SLOT(show()));
//QObject::connect(timer,SIGNAL(timeout()),splash,SLOT(accept()));
//timer->start(100000000000000000);
app.setMainWidget(button);
button->show();
splash->finish(button); 这两句 在 主部件显示之后 就关闭splash 销毁 当然就看不见啦,注释掉这两句看看
delete splash;