<div dir="ltr">I suspect, but can not prove, that this is related to PyOS_InputHook and may depend on exactly which terminal emulator you are using on windows.<div><br></div><div>Tom</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 27, 2019 at 3:01 PM Kyle Altendorf <<a href="mailto:sda@fstab.net">sda@fstab.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="font-size:10pt">
<p>Seems to work ok in 5.9.2 and 5.12.1 in Linux here. I get 16384 (Yes) and 65536 (No).</p>
<p>Though this is an odd program. I thought message boxes maybe ran their own event loop if needed but is showing a button and expecting it's signals to emit functionally really proper?</p>
<p>Cheers,</p>
<p>-kyle</p>
<p><br></p>
<p>On 2019-06-27 14:36, Luke Campagnola wrote:</p>
<blockquote type="cite" style="padding:0px 0.4em;border-left:2px solid rgb(16,16,255);margin:0px">
<div dir="ltr">
<div>Greetings,</div>
<div>I have found that when calling QMessageBox.question, the message box flashes up briefly before disappearing and the call returns NoButton. This behavior is present in both PyQt4 and PyQt5 (most recently tested on 5.9.2 from anaconda package), on windows (but not linux), and only if I have not called QApplication.exec_() because I am running in an interactive python shell. </div>
<div> </div>
<div>Code to reproduce (run with python -i):</div>
<div> </div>
<div style="margin-left:40px">import sys<br>#from PyQt4 import QtGui as QtWidgets<br>from PyQt5 import QtWidgets</div>
<div style="margin-left:40px"> </div>
<div style="margin-left:40px">app = QtWidgets.QApplication([])<br><br>def msg():<br> print(QtWidgets.QMessageBox.question(btn, "title", "message"))<br><br>btn = QtWidgets.QPushButton("show messagebox")<br>btn.clicked.connect(msg)<br>btn.show()<br><br></div>
<div style="margin-left:40px"># message box works if event loop is started</div>
<div style="margin-left:40px"># app.exec_()</div>
<div style="margin-left:40px"> </div>
<div> </div>
<div>Cheers,</div>
<div>Luke</div>
</div>
<br>
<div class="gmail-m_6485799613692692490pre" style="margin:0px;padding:0px;font-family:monospace">_______________________________________________<br> PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br><a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noopener noreferrer" target="_blank">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></div>
</blockquote>
</div>
_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noreferrer" target="_blank">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Thomas Caswell<br><a href="mailto:tcaswell@gmail.com" target="_blank">tcaswell@gmail.com</a></div>