aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/quickcontrols/menus/cppsettings.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/quickcontrols/menus/cppsettings.h')
-rw-r--r--tests/manual/quickcontrols/menus/cppsettings.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/manual/quickcontrols/menus/cppsettings.h b/tests/manual/quickcontrols/menus/cppsettings.h
new file mode 100644
index 0000000000..158ed1b20d
--- /dev/null
+++ b/tests/manual/quickcontrols/menus/cppsettings.h
@@ -0,0 +1,38 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#ifndef CPPSETTINGS_H
+#define CPPSETTINGS_H
+
+#include <QObject>
+#include <QQmlEngine>
+#include <QSettings>
+
+class CppSettings : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool dontUseNativeMenuWindows READ dontUseNativeMenuWindows WRITE setDontUseNativeMenuWindows
+ NOTIFY dontUseNativeMenuWindowsChanged FINAL)
+ Q_PROPERTY(bool dontUseNativeMenuBar READ dontUseNativeMenuBar WRITE setDontUseNativeMenuBar
+ NOTIFY dontUseNativeMenuBarChanged FINAL)
+ QML_ELEMENT
+ QML_SINGLETON
+
+public:
+ explicit CppSettings(QObject *parent = nullptr);
+
+ bool dontUseNativeMenuWindows() const;
+ void setDontUseNativeMenuWindows(bool dontUseNativeMenuWindows);
+
+ bool dontUseNativeMenuBar() const;
+ void setDontUseNativeMenuBar(bool dontUseNativeMenuBar);
+
+signals:
+ void dontUseNativeMenuWindowsChanged();
+ void dontUseNativeMenuBarChanged();
+
+private:
+ QSettings mSettings;
+};
+
+#endif // CPPSETTINGS_H