Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Fix GridLayoutTest.qml
Browse files Browse the repository at this point in the history
tst_Layouts::gridLayout still fails due to
https://bugreports.qt.io/browse/QTBUG-66747

Task-Id: RND-193
  • Loading branch information
0x6e committed Mar 26, 2018
1 parent b691623 commit 3be4a64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions tests/auto/layouts/qml/GridLayoutTest.qml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ Widget {
}
PushButton {
text: "+"
sizePolicy {
horizontalPolicy: SizePolicy.Minimum
verticalPolicy: SizePolicy.Minimum
}

GridLayout.row: 1
GridLayout.column: 3
Expand Down Expand Up @@ -116,6 +120,10 @@ Widget {
}
PushButton {
text: "Enter"
sizePolicy {
horizontalPolicy: SizePolicy.Minimum
verticalPolicy: SizePolicy.Minimum
}

GridLayout.row: 3
GridLayout.column: 3
Expand Down
4 changes: 2 additions & 2 deletions tests/auto/layouts/tst_layouts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 3be4a64

Please sign in to comment.