PyQt's magical disappearing (but not reappearing) windows on Mac OS X
Alec Jacobson
November 16, 2009
After the grueling Qt and PyQt installation process on my Mac OS X 10.5 machine, I have PyQt up and running. I made a little hello, window type app for a sanity test and found a very puzzling feature. PyQt can make a resizable window which the mouse can resize to nothing! This is not allowed through the API methods (namely widget.resize(...,...)
), with those the window always keeps a minimum width and height. But the user is allowed to drag the window to nothingness. If the user lets go while the window has non-positive dimensions then the window is lost forever as far as the mouse user is concerned.
Here's the simple PyQt code:
import sys
from PyQt4 import QtGui
app = QtGui.QApplication(sys.argv)
widget = QtGui.QWidget()
widget.show()
sys.exit(app.exec_())
And here are some screenshots of the result:
Update:
Here's an animated gif version illustrating the above:
Update:
Shucks! Seems like this is fixed in the new version of PyQt4 that I just got.