pyqt scrollview layout

Felix Steffenhagen felix.steffenhagen at gmx.de
Fri Jul 21 05:54:21 EDT 2006


Hello,

I have a problem with updating contents in a qscrollview.
I've implementented two widgets (PremiseInput and PremiseList).
You can find the source code under
http://www.informatik.uni-freiburg.de/~steffenh/premiseinput.{html|py} and
http://www.informatik.uni-freiburg.de/~steffenh/premiselist.{html|py}

The PremiseInput is a widget containing two QLineEdit's and a QComboBox.
This widget should be showed in the PremiseList widget, where I want
the functionality to dynamically add new PremiseInputs and the widths
of them should be adjusted to the width of the QScrollView, contained
in the PremiseList.
And there is my problem.

The PremiseInput has a sizeHint of 333. When I show the standard PremiseList,
the viewport of the scrollview has this size. But when I resize the PremiseList
widget to a lower or higher width and add a new PremiseInput, the size is
adjusted to the sizeHint and I'm not able to resize the QScrollView content
which is too small for larger window sizes and to high for smaller ones.

My resizeEvent method works, so that widget resizes also resize the QScrollView
and its content, but when I want to add the same functionality to the
addPremise() method, nothing happens.

Does anyone know where the problem lies and perhaps has a solution for me?

regards,
Felix



More information about the Python-list mailing list