#include <QtGui/QApplication>
#include<QTimer>
#include <QSplashScreen>
#include <QMainWindow>
int main(int argc, char *argv[])
{
//splash.setMask(pixmap.mask());
splash.
showMessage(QString("Loading..."),Qt
::AlignCenter | Qt
::AlignBottom,
QColor(0,
150,
255));
splash.show();
QTimer::singleShot(1500,
&splash,
SLOT(close
()));
QTimer::singleShot(1500,
&mainWin,
SLOT(show
()));
return a.exec();
}
#include <QtGui/QApplication>
#include<QTimer>
#include <QSplashScreen>
#include <QMainWindow>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QPixmap pixmap(":/splash.png");
QSplashScreen splash(pixmap);
//splash.setMask(pixmap.mask());
splash.showMessage(QString("Loading..."),Qt::AlignCenter | Qt::AlignBottom,QColor(0,150,255));
splash.show();
QMainWindow mainWin;
QTimer::singleShot(1500, &splash, SLOT(close()));
QTimer::singleShot(1500, &mainWin, SLOT(show()));
return a.exec();
}
To copy to clipboard, switch view to plain text mode
only the main window is displayed after timeout. the image splash.png is in my working directory.
Bookmarks