summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-10-18 09:07:37 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-10-25 12:12:39 +0200
commitdff3843d98d52e2c32fea07371f91117de0667e9 (patch)
tree028199eebf8d92722de91412e32352c54cbd5183 /tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
parent5d5a0842dc87645eab468389198750adc01b0618 (diff)
QShortcut: Properly port to the new configure system
Move the feature to corelib so that the QMetaType enumeration values can be properly excluded and there is no need for a dummy class. Use QT_REQUIRE_CONFIG in the headers of classes to be disabled. Add headers/source files in the .pro file depending on the configure feature in libraries and tests. Add the necessary exclusions and use QT_CONFIG. Task-number: QTBUG-76493 Change-Id: I02499ebee1a3d6d9a1e5afd02517beed5f4536b7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp')
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index c6760000f4..45a35fe4f1 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -99,7 +99,9 @@ class tst_QFormLayout : public QObject
private slots:
void cleanup();
void rowCount();
+#if QT_CONFIG(shortcut)
void buddies();
+#endif
void getItemPosition();
void wrapping();
void spacing();
@@ -190,6 +192,8 @@ void tst_QFormLayout::rowCount()
//TODO: remove items
}
+#if QT_CONFIG(shortcut)
+
void tst_QFormLayout::buddies()
{
QWidget w;
@@ -218,6 +222,8 @@ void tst_QFormLayout::buddies()
//TODO: empty label?
}
+#endif // QT_CONFIG(shortcut)
+
void tst_QFormLayout::getItemPosition()
{
QWidget w;
@@ -687,17 +693,21 @@ void tst_QFormLayout::insertRow_QString_QWidget()
layout->insertRow(-5, "&Name:", fld1);
QLabel *label1 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label1 != 0);
+#if QT_CONFIG(shortcut)
QCOMPARE(label1->buddy(), fld1);
-
+#endif
layout->insertRow(0, "&Email:", fld2);
QLabel *label2 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label2 != 0);
+#if QT_CONFIG(shortcut)
QCOMPARE(label2->buddy(), fld2);
-
+#endif
layout->insertRow(5, "&Age:", fld3);
QLabel *label3 = qobject_cast<QLabel *>(layout->itemAt(2, QFormLayout::LabelRole)->widget());
QVERIFY(label3 != 0);
+#if QT_CONFIG(shortcut)
QCOMPARE(label3->buddy(), fld3);
+#endif
}
void tst_QFormLayout::insertRow_QString_QLayout()
@@ -711,21 +721,27 @@ void tst_QFormLayout::insertRow_QString_QLayout()
layout->insertRow(-5, "&Name:", fld1);
QLabel *label1 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label1 != 0);
+#if QT_CONFIG(shortcut)
QVERIFY(!label1->buddy());
+#endif
QCOMPARE(layout->rowCount(), 1);
layout->insertRow(0, "&Email:", fld2);
QLabel *label2 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label2 != 0);
+#if QT_CONFIG(shortcut)
QVERIFY(!label2->buddy());
+#endif
QCOMPARE(layout->rowCount(), 2);
layout->insertRow(5, "&Age:", fld3);
QLabel *label3 = qobject_cast<QLabel *>(layout->itemAt(2, QFormLayout::LabelRole)->widget());
QVERIFY(label3 != 0);
+#if QT_CONFIG(shortcut)
QVERIFY(!label3->buddy());
+#endif
QCOMPARE(layout->rowCount(), 3);
}