سؤال

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_->CloseActualScreen();
display_->SetScreenId( MTO_Display::WAITING_SCREEN );
display_->ChooseScreenToDisplay();

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_->CloseActualScreen();
display_->SetScreenId( MTO_Display::WAITING_SCREEN );
display_->ChooseScreenToDisplay();
CallToAnotherFunction();

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 !

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top