diff --git a/tests/auto/layouts/qml/GridLayoutTest.qml b/tests/auto/layouts/qml/GridLayoutTest.qml index 4da56d9..4f312b5 100644 --- a/tests/auto/layouts/qml/GridLayoutTest.qml +++ b/tests/auto/layouts/qml/GridLayoutTest.qml @@ -73,6 +73,10 @@ Widget { } PushButton { text: "+" + sizePolicy { + horizontalPolicy: SizePolicy.Minimum + verticalPolicy: SizePolicy.Minimum + } GridLayout.row: 1 GridLayout.column: 3 @@ -116,6 +120,10 @@ Widget { } PushButton { text: "Enter" + sizePolicy { + horizontalPolicy: SizePolicy.Minimum + verticalPolicy: SizePolicy.Minimum + } GridLayout.row: 3 GridLayout.column: 3 diff --git a/tests/auto/layouts/tst_layouts.cpp b/tests/auto/layouts/tst_layouts.cpp index 9e8f3f0..8eefa78 100644 --- a/tests/auto/layouts/tst_layouts.cpp +++ b/tests/auto/layouts/tst_layouts.cpp @@ -430,8 +430,7 @@ void tst_Layouts::compareWidgets(QWidget *a, QWidget *b) QVERIFY2(a != nullptr, "a QWidget is null"); QVERIFY2(b != nullptr, "b QWidget is null"); - QVERIFY2(a->sizePolicy() == b->sizePolicy(), "Expected size policy to match"); - + compareSizePolicy(a->sizePolicy(), b->sizePolicy()); compareLayouts(a->layout(), b->layout()); compareGeometry(a->geometry(), b->geometry()); } @@ -497,6 +496,7 @@ void tst_Layouts::compareSizePolicy(const QSizePolicy& aPolicy, const QSizePolic , qPrintable(QStringLiteral("verticalStretch does not match (%1 != %2") .arg(aPolicy.verticalStretch()) .arg(bPolicy.verticalStretch()))); + // Tests may fail here due to [QTBUG-66747] uic generates incorrect code to set QSizePolicy QVERIFY2(aPolicy.controlType() == bPolicy.controlType() , qPrintable(QStringLiteral("controlType does not match (%1 != %2") .arg(aPolicy.controlType())