[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] postEvent(), blocking processEvents() and QMessageBox.exec_
From:       Carl Wolff <carl () wolff-online ! nl>
Date:       2016-05-27 15:18:50
Message-ID: CA+89xzRtstzHMECCiawGh6xxStGMhx3uAzo9VSMUk0LFGxmyKQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,
Already found the problem (I think)

msg.exec_() == PyQt4.QtGui.QMessageBox.Yes is blocking. As the whole thing
has just one single thread, there is no opportunity to post the event which
closes the dialog...

Best regards
Carl.


2016-05-27 16:38 GMT+02:00 Carl Wolff <carl@wolff-online.nl>:

> Hello,
>
> in my application I am posting (earlier recorded) events using the
> postEvents() call. After each postEvent() call I always call
> processEvents() to let the application process the event.
>
> When the logic of my app shows a modal dialog (as a result of the posted
> event) using the following snippet:
> msg = PyQt4.QtGui.QMessageBox(self)
>
> ...
>
> return msg.exec_() == PyQt4.QtGui.QMessageBox.Yes
>
> then the processEvents() call blocks.
>
> Can somebody give some hints here, what the cause is?
>
> Best regards
>
> Carl.
>
>

[Attachment #5 (text/html)]

<div dir="ltr"><div>Hello,</div>Already found the problem (I \
think)<div><br></div><div><span style="color:rgb(0,0,0);font-family:&#39;Courier \
New&#39;;font-size:9pt;white-space:pre-wrap">msg.exec_() == \
PyQt4.QtGui.QMessageBox.Yes </span>is blocking. As the whole thing has just one \
single thread, there is no opportunity to post the event which closes the \
dialog...</div><div><br></div><div>Best \
regards</div><div>Carl.</div><div><br></div></div><div class="gmail_extra"><br><div \
class="gmail_quote">2016-05-27 16:38 GMT+02:00 Carl Wolff <span dir="ltr">&lt;<a \
href="mailto:carl@wolff-online.nl" \
target="_blank">carl@wolff-online.nl</a>&gt;</span>:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>in my application I \
am posting (earlier recorded) events using the postEvents() call. After each \
postEvent() call I always call processEvents() to let the application process the \
event.</div><div><br></div><div>When the logic of my app shows a modal dialog (as a \
result of the posted event) using the following snippet:</div><div><font \
color="#000000" style="font-family:&#39;Courier New&#39;;font-size:9pt">msg = \
PyQt4.QtGui.QMessageBox(</font><span style="font-family:&#39;Courier \
New&#39;;font-size:9pt;color:rgb(148,85,141)">self</span><font color="#000000" \
style="font-family:&#39;Courier New&#39;;font-size:9pt">)</font><br></div><div><pre \
style="font-family:&#39;Courier New&#39;;font-size:9pt"><font \
color="#000000">...</font></pre><pre style="font-family:&#39;Courier \
New&#39;;font-size:9pt"><font color="#000000">return msg.exec_() == \
PyQt4.QtGui.QMessageBox.Yes<br></font></pre><pre><font face="arial, sans-serif">then \
</font><font face="arial, sans-serif">the processEvents() </font><span \
style="font-family:arial,sans-serif">call blocks.</span></pre><pre><span \
style="font-family:arial,sans-serif">Can somebody give some hints here, what the \
cause is?</span><br></pre><pre><span style="font-family:arial,sans-serif">Best \
regards</span><span class="HOEnZb"><font \
color="#888888"><br></font></span></pre><span class="HOEnZb"><font \
color="#888888"><pre><span \
style="font-family:arial,sans-serif">Carl.</span></pre></font></span></div></div> \
</blockquote></div><br></div>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic