PDA

View Full Version : QSplashScrren before QDialog



kalwi
4th August 2013, 14:30
Hi, I have a problem. I've got a main window and run from it QDialog. QDialog in the constructor loads a lot of data (it takes about 3-4 seconds while the program is not responding):

Statistics * s = new Statistics (this->klient, this);
s->exec();
delete s;
I wanted to make splash screen to fill this gap. And when constructor go to end emits a signal that is associated with a slot close() of splash screen:

QSplashScreen * sS = new QSplashScreen(QPixmap(":/images/logo"));
sS->ShowMessage("Generating statistics", Qt::AlignCenter);
sS->show();
Statistics * s = new Statistics(this->klient, this);
connect (s, SIGNAL (loaded()), sS, SLOT (close()));
s->exec ();
disconnect (s, SIGNAL (loaded ()), sS, SLOT (close ()));
delete s, sS;
Unfortunately splash screen doesn't show from the beginning, only for a moment before opening QDialog.

Do you have any idea how to solve it?

ChrisW67
5th August 2013, 00:58
It is all in the QSplashScreen detailed description.

kalwi
5th August 2013, 12:13
Doesn't work for me, still it is showed only for a moment before displaying QDialog.