PDA

View Full Version : Independent splash screen



ndev
23rd September 2014, 15:29
Hi guys, I've little problem and don't know how to fix it.
I need to create splash screen (with animation) during application creates UI (many dialogs and widgets).
Splash dialog uses QMovie for animation and it needs that application processes events to change frames. This is main problem, if I put QApplication::processEvents into code that make initialization, loading time increases and also my animation starts jerking because time interval is different from one processEvents to another. I believe there is some solution how to run two UI widgets the same time without freezing.

anda_skoa
23rd September 2014, 16:05
You need to find out what is blocking the main UI's initialization.

Cheers,
_

ndev
23rd September 2014, 16:31
How this will help ? Main thread creates a lot of widgets and I don't want to put call of processEvents on every line of that code. I need to create widget(dialog) that is detached from main thread. Is this possible ?

anda_skoa
23rd September 2014, 18:52
You don't have to add process event into places, just to make sure that whatever code is processed by the main thread doesn't take too long.

E.g. by calling delayed creation methods through a single shot timer or QMetaObject::invokeMethod and have each of those contain code that can be executed quickly enough.

Your other option is to run the splash screen as a separate application, e.g. through QProcess, or the other way around.

But the most essential thing is always to determine which part of the code actually causes the blocking

Cheers,
_