PDA

View Full Version : How to show Widget instantly



gQt
23rd July 2010, 11:48
Hi all!

I have written an application that is used in collecting data for sensors during calibration. In the constructor of the class, the code for creating a mainwindow with several dockWidgets is executed before the sensor information (serialNumber) is collected. But the mainwindow is first displayed after the sensor information i collected. Is it possible to display the mainwindow before the rest of the code in the constructor is executed, or can a widget first be shown after all the code in the constructor is executed ? Any help would be deeply appreciated!

Thanks
gQt

Lykurg
23rd July 2010, 12:29
I see two possibilities. Do the collecting in a different thread or before/while collecting call QCoreApplication::processEvents().

Or you can use your main window's QEvent::Show event and after you receive that, start collecting.

gQt
7th August 2010, 09:36
Thanks for the answer Lykurg! I will be away from my Qt-computer for one more week, then I will try your suggestions.