[PyQt] setting Popup windowFlag causes system to become unresponsive

Jugdish jugdizh at gmail.com
Fri Nov 27 18:34:31 GMT 2009


For some reason if I set the windowFlag "Popup" on a QListWidget, the widget
takes modal focus and it is impossible to give focus back to any widget. In
fact, my entire system becomes unresponsive. Only the QListWidget responds
to input, and I have no way of killing the process. Here is a very stripped
down example of this problem:

##############################
from PyQt4 import QtCore, QtGui

app = QtGui.QApplication([])

w = QtGui.QListWidget()
w.setWindowFlags(QtCore.Qt.Popup)
w.addItems(["foo","bar","baz"])

button = QtGui.QPushButton("Click Me")
QtCore.QObject.connect(button, QtCore.SIGNAL("clicked()"), w.show)
button.show()

app.exec_()
##############################

When I run this bit of code and click on the button, a QListWidget pops up
on top of everything. I can select each of the 3 items in the list as
expected, but if I click anywhere outside the QListWidget, nothing responds,
not even if I try to click on items in the taskbar or the windows for other
running apps! It has something to do with it being a QListWidget, because if
I change it to just a QWidget, I can click outside of it and things still
respond.

Am I doing something wrong or is this a bug?

Here are my system specs:
GNU/Linux x86_64, Fedora release 8 (Werewolf)
PyQt 4.5.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20091127/d1b0b9ba/attachment.html


More information about the PyQt mailing list