Home > Mobile >  After QEventLoop call exec () returns 1
After QEventLoop call exec () returns 1

Time:01-01

Development is Qt desktop application that requires blocking calls, began to call the exec is 0 is returned to normal, the quit can timely response, but return 1, a call back will return 1 call after the quit again call exec or useless, or return 1, using pointer, behind the destructor call New again, call exec or return 1, don't know why will always return 1, excuse me what reason be cause ah, see the source code

QMutexLocker locker (& amp; Static_cast & lt; QThreadPrivate * & gt; (QObjectPrivate: : get (d - & gt; ThreadData - & gt; The thread)) - & gt; Mutex);
If (d - & gt; ThreadData - & gt; QuitNow)
return -1;

If (d - & gt; InExec) {
QWarning (" QEventLoop: : exec: instance % p has already called the exec () ", this);
return -1;
}

That sounds like the judgment in front of the back - 1, because the back of the return 1 print, there is no printing and I call, do not know the specific what triggered return 1

CodePudding user response:

Wave of the wind, I know you

CodePudding user response:

reference 1st floor feiyangqingyun response:
wind waves, I know you

I want to be you smile dead, he has to evade the question, but the analysis of the causes of trigger may be called multiple times didn't release it, anyway, now also is one of the curve to solve

CodePudding user response:

I think you should put your code, rather than the Qt code,

CodePudding user response:

Dext
reference 3 floor response:
I think you should put your code, rather than the Qt code,

I have the code is


Is to load the exec () return 1
  •  Tags:  
  • Qt
  • Related