PDA

View Full Version : How can i prozess a slot function partially before moving on?



Cal
19th December 2008, 11:14
Hey,

Sorry for the bad title... but i dont know how to describe my problem properly in a few words.

I Have a slot function in my QWidget derived class:


void TrackWindow::createMask() {
cout("Building mask..."); //writes some text on a QTextEdit
bee_radar->createMask(); // processes some Image Data
cout("Mask created.");
display_mode_box->setCurrentIndex(1);
displayMode(1);
}

If i call that slot by a Signal, it processes all the steps, and then displays the text at once. But i want to send "Building Mask" to my QTextEdit WIdget first,display it, and then process the other steps. How can i do that? :)

Thanks for your help!
Cal

rexi
19th December 2008, 14:06
You could try if QCoreApplication::processEvents solves your problem. Add a call to this method after you sent the text to your widget, and before doing the other stuff. This should give Qt a chance to update the widgets before you continue with your task.

Cal
19th December 2008, 16:57
thanks! works perfectly! :)