Le 14/1/2009, "Doug Bell" <[email protected]> a écrit:
>Try overriding QLayoutItem.hasHeightForWidth() and
>QLayoutItem.heightForWidth(w) in a custom layout.
It does not seems to work :o( The layout does not remains sqaure...
Here is part the code involved:
def hasHeightForWidth(self):
return True
def heightForWidth(self, width):
return width
...
mainWindow = uic.loadUi("mainWindow.ui")
mainWindow.myGridLayout.heightForWidth = \
types.MethodType(heightForWidth, mainWindow.myGridLayout)
mainWindow.myGridLayout.hasHeightForWidth = \
types.MethodType(hasHeightForWidth, mainWindow.myGridLayout)
...
Could it come from the fact I'm using the uic module to load my GUI? Or
because I dynamically rebind the methods (from a python point of view,
it works, as I checked that my methods are called)?
BTW, is it possible to do the opposite, setting the width from the
height? I didn't find any methods, which is strange from Qt...
--
Frédéric
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt