Update of /cvsroot/anygui/anygui/lib/anygui/backends
In directory sc8-pr-cvs1:/tmp/cvs-serv8853/lib/anygui/backends
Modified Files:
qtgui.py
Log Message:
Fixed the window offset problem in qtgui. The setGeometry of QMainWindow
doesn't take into account the window frame. I changed
WindowWrapper.setGeometry to use QMainWindow.move() and QMainWindow.resize()
instead -- not sure whether resize() takes the window frame into account.
One related bug remains: When the window is resized so that comtained
components get negative dimensions, qt will keep them at zero (naturally),
and when the window has its size increased again, the component dimensions
will be wrong.
Index: qtgui.py
===================================================================
RCS file: /cvsroot/anygui/anygui/lib/anygui/backends/qtgui.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** qtgui.py 29 Jan 2003 01:43:43 -0000 1.28
--- qtgui.py 17 Feb 2003 02:53:15 -0000 1.29
***************
*** 531,536 ****
dh = h - self.proxy.state['height'] # @@@ (and therefore will tell us nothing!)
! self.proxy.height
! self.proxy.width
self.proxy.resized(dw, dh)
--- 531,536 ----
dh = h - self.proxy.state['height'] # @@@ (and therefore will tell us nothing!)
! self.proxy.height # FIXME: What's this? [mlh]
! self.proxy.width # FIXME: What's this? [mlh]
self.proxy.resized(dw, dh)
***************
*** 602,610 ****
def setGeometry(self, x, y, width, height):
if self.widget:
! self.mainWindow.setGeometry(x, y, width, height)
def getGeometry(self):
if self.widget:
! r = self.widget.geometry()
p = self.widget.mapToGlobal(QPoint(r.x(), r.y()))
return (p.x(), p.y(), r.width(), r.height())
--- 602,614 ----
def setGeometry(self, x, y, width, height):
if self.widget:
! # Doesn't account for the frame:
! #self.mainWindow.setGeometry(x, y, width, height)
! self.mainWindow.move(x, y)
! # FIXME: Does resize account for the window frame?
! self.mainWindow.resize(width, height)
def getGeometry(self):
if self.widget:
! r = self.widget.frameGeometry()
p = self.widget.mapToGlobal(QPoint(r.x(), r.y()))
return (p.x(), p.y(), r.width(), r.height())
|