[PyQt] Mysterious change of QWidget.width()

Michael Wyss wysm at zhaw.ch
Mon Feb 2 16:34:27 GMT 2009


Hello.
I am using QListView() in IconMode and a QAbstractListModel() to view 
some QWidget()'s which i have to render first into QPixmap() in order to 
get them into the model.
The QWidget() ajusts its size to the one to four QLabel()'s in it.
Now i have a mysterious problem with the width of the QWidget() (fixed 
size) which gets altered and is not possible to change afterwards, at a 
undefined position in the code inside the for-loop where I prepare the 
content of the QWidget(), render it and add it to the QAbstractListModel() .
I wasn't able to spot the exact location of that change because it seems 
to happen somewhere in between the lines, meaning, when the compiler 
gets into the method where i insert the QPixmap() into the model. 
However, it can also happen earlier when I "step into" and don't "step 
over" a method before that, in debugging-mode.
After hours of searching the source of the problem I have no clue what 
to do anymore... What am I missing here?
Thanks for your consideration.
Michael


More information about the PyQt mailing list