aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-02-07 10:52:42 +0100
committerUlf Hermann <ulf.hermann@qt.io>2023-02-15 14:04:44 +0100
commit82cda71298e3eea40f7379b412b0a36fe401b48a (patch)
tree4125e70f6c0e6129f2ceb922ca284dd80833c18d /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parent75a41f0773b840419369c9395610caca7748b9eb (diff)
Controls: Use PlatformDialogHelper for enums in DialogButtonBox
Since we're already using 3 of the 4 enums in PlatformDialogHelper, we can just as well declare PlatformDialogHelper as extended namespace and avoid all the fiddling with Q_ENUMS and QFLAGS. As an additional upside, we get code using those enums to compile to C++ this way. Pick-to: 6.5 Fixes: QTBUG-110933 Change-Id: I60bfc15c94133be368fa98ee1b3a0ab7a2bc53ef Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 400075c08d..222d4cb245 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -12,6 +12,7 @@
#include <QtTest>
#include <QtQml>
#include <QtGui/qcolor.h>
+#include <QtGui/qpa/qplatformdialoghelper.h>
#if QT_CONFIG(process)
#include <QtCore/qprocess.h>
@@ -164,6 +165,7 @@ private slots:
void dateConversions();
void valueTypeBehavior();
void invisibleSingleton();
+ void dialogButtonBox();
};
void tst_QmlCppCodegen::initTestCase()
@@ -3211,6 +3213,21 @@ void tst_QmlCppCodegen::invisibleSingleton()
QCOMPARE(o->property("c"), QVariant(QMetaType::fromName("QColor")));
}
+void tst_QmlCppCodegen::dialogButtonBox()
+{
+ QQmlEngine engine;
+ const QUrl copy(u"qrc:/qt/qml/TestTypes/dialogButtonBox.qml"_s);
+ QQmlComponent c(&engine, copy);
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(!o.isNull());
+ QObject *footer = o->property("footer").value<QObject *>();
+ QVERIFY(footer);
+
+ QCOMPARE(footer->property("standardButtons").value<QPlatformDialogHelper::StandardButton>(),
+ QPlatformDialogHelper::Ok | QPlatformDialogHelper::Cancel);
+}
+
QTEST_MAIN(tst_QmlCppCodegen)
#include "tst_qmlcppcodegen.moc"