读书人

QSplashScreen实验失败…解决方案

发布时间: 2012-11-06 14:07:00 作者: rapoo

QSplashScreen实验失败……
我制作了一个很小的实现,目的是显示三秒SplashScreen,随后关闭。但是我写的代码好像没有得出效果。下面是我的小程序。

C/C++ code
#include <QApplication>#include <QTimer>#include <QSplashScreen>void FinishSplash( QSplashScreen* splash ){    splash->finish( 0 );    delete splash;}int main( int argc, char** argv ){    QApplication app( argc, argv );    QSplashScreen* splash = new QSplashScreen;    splash->setPixmap( QPixmap( "TestImage.jpg" ) );    splash->show( );    QTimer timer;    timer.setSingleShot( true );    timer.start( 3000 );    QObject::connect( &timer, SIGNAL( timeout( ) ),                      0, SLOT( FinishSplash( ) ) );    return app.exec( );}

请问我该怎么办呢?

[解决办法]
connect成功了吗 FinishSplash要声明为槽才可以

读书人网 >QT开发

热点推荐