#include<QtGui>
class timer: public QWidget
{
Q_OBJECT
public:
timer();
~timer();
private:
void intconect();
private slots:
void timeoutdo();
};
#include<QtGui>
#include <QPixmap>
#include<QSplashScreen>
#include<timer.h>
timer::timer()
{
//QObject::connect(time, SIGNAL(timeout()), this, SLOT(timeoutdo()));
intconect();
timeoutdo();
}
timer::~timer()
{
}
void timer::intconect()
{
QObject::connect(time, SIGNAL(timeout()), this, SLOT(timeoutdo()));
}
void timer::timeoutdo()
{
time->start(5000);
QPixmap foreground("image/startScreen.jpg");
QSplashScreen *screen= new QSplashScreen;
screen->setPixmap(foreground);
screen->setGeometry(QRect(0, 50, 640, 480));
screen->show();
screen->showMessage("载入中,请稍候........",Qt::AlignCenter,Qt::white);
timer->stop();
}
主函数调用QTimer timer;
timer.start(10000);
但是还是没有看到那个画布停了几秒
清斑竹帮帮忙