diff options
Diffstat (limited to 'tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp')
-rw-r--r-- | tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp index 135605f185..d04b812878 100644 --- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp +++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp @@ -47,6 +47,7 @@ #include <qproxystyle.h> #include <qsizepolicy.h> +#include <QtWidgets/QCheckBox> #include <QtWidgets/QLabel> #include <QtWidgets/QLineEdit> #include <QtWidgets/QPushButton> @@ -347,6 +348,19 @@ void tst_QFormLayout::spacing() style->hspacing = 20; //QCOMPARE(fl->spacing(), 20); + + + // Do not assert if spacings are negative (QTBUG-34731) + style->vspacing = -1; + style->hspacing = -1; + QLabel *label = new QLabel(tr("Asserts")); + QCheckBox *checkBox = new QCheckBox(tr("Yes")); + fl->setWidget(0, QFormLayout::LabelRole, label); + fl->setWidget(1, QFormLayout::FieldRole, checkBox); + w->resize(200, 100); + w->show(); + QVERIFY(QTest::qWaitForWindowExposed(w)); + delete w; delete style; } |