[PyQt] Width() is whack [continued, first message was incomplete]

Vincent Vande Vyvre vincent.vande.vyvre at telenet.be
Mon Jun 1 22:43:36 BST 2015


Le 01/06/2015 23:19, inhahe a écrit :
> i've created a minimal example to show the issues I'm having.
> here's the code: http://pastebin.com/RzEtFKDW
> here's the output I get:
>
> self.width before setsizes: 640
> nicks & text widths before setsizes: 100 100
> splitter width before setsizes: 100
> splitter.geometry.width before setsizes: 100
> self.width after setsizes: 640
> nicks & text widths after setsizes: 47 47
> splitter width after setsizes: 100
> splitter.geometry.width after setsizes: 100
> sizes from channelwindow: [47, 47]
> sizes from main: [47, 47]
> sizes from keypress: [1208, 700]
>
> ....


All yours measurement of the widgets are wrong and yours actions to set 
the size of the widgets are inappropriate at the creation of the window.

The window is not already visible, the size values are false.

You need to:

*  show() the window
*  Apply QtCore.QCoreQApplication.processEvents()
*  And then you can play with the size of the widgets.



More information about the PyQt mailing list