[Qt-interest] QApplication::ProcessEvent ASSERT problem activationRecursionGuard
Andreas Pakulat
apaku at gmx.de
Tue Apr 21 14:17:43 CEST 2009
On 21.04.09 11:40:25, Giancarlo Amati wrote:
>
> Good morning everybody, I hope this will find an answer:
>
> I have a menu voice which activate the following loop
>
>
>
> while(_mBoolStartCapture){
> QCoreApplication::processEvents();
> printf("pippo\n");
> }
>
> Now, everything is fine. I can keep working and using my software untill I go back to the main manu and select another voice. Now, as soon as the mouse is over a voice and I click on it, it occurs this ASSERT message:
>
> ASSERT: "!activationRecursionGuard" in file widgets\qmenu.cpp, line 959
>
>
> Now, I have three options: 1- Abort so i have to stop, 2- retry and 3 - ignore. Now for renty and Ignore, that's fine because I can keep my software working but having this message is a bit annoying and not really professional. So, how can I get rid of this and why this messages comes out?!
You shouldn't do either retry nor ignore, this messages tells you something
is fundamentally wrong in your application. Thats an error you should fix.
In this particular case you simply shouldn't call processEvents, but
instead leave the GUI thread running and schedule whatever work is done in
the loop via a QTimer or move it to a separate thread.
Andreas
--
Don't plan any hasty moves. You'll be evicted soon anyway.
More information about the Qt-interest-old
mailing list