Take the 2-minute tour ×

I am trying to develop a Qt application for a touchscreen ; this application is running on an ARM system, with Qt Everywhere 4.7.2.

In this application, I need to display a specific screen for login ; then the user press an "Ok" button, and I must verify if the informations entered are correct. To do that, I need to send a message to my server and while doing that, I would like to display a waiting screen. I have already a some classes that allow me to switch between screens, and it works. The problem is : when I put some code after the display request, it is executed but the screen doesn't display !

An example :

display_->SetScreenId( MTO_Display::WAITING_SCREEN );

It is basically the way I switch between screen ; display_ is a specific object. The method CloseActualScreen() closes the screen being display by deleting its object. Then ChooseScreenToDisplay() creates and display a new widget depending on the screen id. I can put these method's code if needed, but they work if I used them like that.

Then, if I do that :

display_->SetScreenId( MTO_Display::WAITING_SCREEN );

CallToAnotherFunction() is well executed but here my waiting screen is not displayed at all ; I see no reason for this behavior !

Do you have an idea ?

Thanks !

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Arg x) I searched on this for two days, and found the solution just after asking here... x) I need to use QApplication::processEvents in order to process all events before executing the rest of the code.

share|improve this answer
yes, you should read this article about threads and events: developer.qt.nokia.com/wiki/Threads_Events_QObjects especially "Events and the event loop part" –  Maciej Dec 12 '11 at 9:00
add comment

Your Answer


