[PyQt] Bug in QWidget.geometry()?
phil at riverbankcomputing.com
Wed Feb 29 16:36:57 GMT 2012
On Wed, 29 Feb 2012 11:29:38 -0500, Nathan Weston <nathan at genarts.com>
> According to the Qt docs, QWidget.geometry() should return the geometry
> of the widget itself, not including the window border. But I'm finding
> that's not the case -- geometry() is including the borders and returning
> the same value as frameGeometry().
> However, setGeometry() behaves as documented, which has the interesting
> side effect that window.setGeometry(window.geometry()) moves the window!
> I'm using Qt 4.8.0 and PyQt 4.9 on Windows 7.
> The attached test program demonstrates the problem. I use move() (which
> *does* account for window borders) to position the window at the upper
> left of the screen. But then a call to self.setGeometry(self.geometry())
> moves the window off screen.
> Interestingly, the value of geometry() is the same before and after the
> call to setGeometry(), despite the fact that the window has moved on
If it's a bug it's a Qt bug, nothing to do with PyQt.
More information about the PyQt