Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.5.1, 5.10.0
-
None
Description
When setting the QSizeProperty attributes using a .ui file, uic generates code which overrides the widget's original QSizeProperty::control type.
For example:
<widget class="QPushButton" name="example"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> </widget>
Generates:
QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(example->sizePolicy().hasHeightForWidth()); example->setSizePolicy(sizePolicy);
The QSizePolicy should be constructed from the widget's existing QSizePolicy in order to preserve the QSizePolicy::controlType.
ControlType.zip contains a failing unit test.