And in this case:
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QSplashScreen>
#include <QTimer>
int main(int argc, char *argv[])
{
splash
->setPixmap
(QPixmap("f0.png"));
splash->show();
splash
->showMessage
(QObject::trUtf8("A preparar a janela principal ..."), Qt
::AlignRight|Qt
::AlignTop, Qt
::black);
MainWindow w;
QTimer::singleShot(5000, splash,
SLOT(close
()));
QTimer::singleShot(5000,
&w,
SLOT(show
()));
//delete splash;
return a.exec();
}
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QSplashScreen>
#include <QTimer>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSplashScreen *splash = new QSplashScreen;
splash->setPixmap(QPixmap("f0.png"));
splash->show();
splash->showMessage(QObject::trUtf8("A preparar a janela principal ..."), Qt::AlignRight|Qt::AlignTop, Qt::black);
MainWindow w;
QTimer::singleShot(5000, splash, SLOT(close()));
QTimer::singleShot(5000, &w, SLOT(show()));
//delete splash;
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Obviously the commented line could not work ... but where to free the used memory by the splash screen?
Thanks
Bookmarks