#include "test.h" #include #include Test::Test() { connect(this,&Test::sig_start1, this, &Test::example1, Qt::QueuedConnection); emit sig_start1(); } void Test::example1() { QSplashScreen * splash = new QSplashScreen(); QPixmap pm(400,400); pm.fill(Qt::gray); splash->setPixmap(pm); QFont f = splash->font(); f.setPointSize(16); splash->setFont(f); splash->show(); splash->showMessage("You should see this"); splash->repaint(); QApplication::processEvents(); lengthyProcess(); } void Test::lengthyProcess() { // This just wastes time to simulate a heavy processing task qDebug() << "start lengthy processing"; qint64 t0 = QDateTime::currentSecsSinceEpoch(); qint64 diff = 0; while (diff < 10) { qint64 t1 = QDateTime::currentSecsSinceEpoch(); diff = t1 - t0; } qDebug() << "end lengthy processing"; }