aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols/wearable/WearableSettings
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quickcontrols/wearable/WearableSettings')
-rw-r--r--examples/quickcontrols/wearable/WearableSettings/CMakeLists.txt45
-rw-r--r--examples/quickcontrols/wearable/WearableSettings/WearableSettings.qml14
-rw-r--r--examples/quickcontrols/wearable/WearableSettings/qmldir5
3 files changed, 64 insertions, 0 deletions
diff --git a/examples/quickcontrols/wearable/WearableSettings/CMakeLists.txt b/examples/quickcontrols/wearable/WearableSettings/CMakeLists.txt
new file mode 100644
index 0000000000..9a839346bd
--- /dev/null
+++ b/examples/quickcontrols/wearable/WearableSettings/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(wearablesettings LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick QuickControls2)
+
+set_source_files_properties(
+ WearableSettings.qml
+ PROPERTIES
+ QT_QML_SINGLETON_TYPE TRUE
+)
+
+qt_policy(SET QTP0001 NEW)
+qt_add_qml_module(wearablesettings
+ URI WearableSettings
+ PLUGIN_TARGET wearablesettings
+ QML_FILES
+ WearableSettings.qml
+)
+
+target_link_libraries(wearablesettings PUBLIC
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Quick
+ Qt6::QuickControls2
+)
+
+if(UNIX AND NOT APPLE AND CMAKE_CROSSCOMPILING)
+ find_package(Qt6 REQUIRED COMPONENTS QuickTemplates2)
+
+ # Work around QTBUG-86533
+ target_link_libraries(wearablesettings PRIVATE Qt6::QuickTemplates2)
+endif()
+
+install(TARGETS wearablesettings
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/WearableSettings"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_BINDIR}/WearableSettings"
+)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmldir
+ DESTINATION "${CMAKE_INSTALL_BINDIR}/WearableSettings"
+)
diff --git a/examples/quickcontrols/wearable/WearableSettings/WearableSettings.qml b/examples/quickcontrols/wearable/WearableSettings/WearableSettings.qml
new file mode 100644
index 0000000000..3af505867c
--- /dev/null
+++ b/examples/quickcontrols/wearable/WearableSettings/WearableSettings.qml
@@ -0,0 +1,14 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+pragma Singleton
+
+import QtCore
+
+Settings {
+ property bool wireless
+ property bool bluetooth
+ property int brightness
+ property bool darkTheme
+ property bool demoMode
+}
diff --git a/examples/quickcontrols/wearable/WearableSettings/qmldir b/examples/quickcontrols/wearable/WearableSettings/qmldir
new file mode 100644
index 0000000000..b11b06ab0b
--- /dev/null
+++ b/examples/quickcontrols/wearable/WearableSettings/qmldir
@@ -0,0 +1,5 @@
+# This file only exists for qmake.
+
+module WearableSettings
+prefer :/qt/qml/WearableSettings/
+singleton WearableSettings 254.0 WearableSettings.qml