graciano
23rd October 2009, 17:32
Hi,
This example show me a splash screen for 5 seconds, an then the main window.
#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()));
return a.exec();
}
During those 5 secs if i click on the QSplassScreen i have "nothing" until the main window shows up.
Can i disable the possibiliti of clicking on the splashscreen?
Thanks
This example show me a splash screen for 5 seconds, an then the main window.
#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()));
return a.exec();
}
During those 5 secs if i click on the QSplassScreen i have "nothing" until the main window shows up.
Can i disable the possibiliti of clicking on the splashscreen?
Thanks