aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDoris Verria <doris.verria@qt.io>2022-10-13 15:05:56 +0200
committerDoris Verria <doris.verria@qt.io>2022-10-21 11:12:20 +0200
commit52fcfdf73d93b6547f36668bf989236322d7fce3 (patch)
treee653337afd29ab403d25a324f2effc041f6ff9f4 /examples
parentb79ae8820b35af7e5e6e86dfb7061e470a6b2143 (diff)
iOS Style: Make QQuickIOSStyle a singleton and private API
We weren't really supporting an attached API for the iOS style, even though QQuickIOSStyle was a QQuickAttachedObject. The QQuickIOSStyle had two properties: theme and url. We were using the read-only IOS.theme property to select the source for the assets based on the theme (light/dark), but this is not needed anymore as we are now using the new Qt.styleHints.appearance property instead. The url property was also not configurable and the controls implementations were using it to access the path of the image assets. As both of these properties were not settable and propagatable, and we don't intend to make them as such, it doesn't make sense to have an attached API for this. So make the QQuickIOSStyle a QObject and a singleton. Remove the theme property. Since the API doesn't need to be public, move it to the private iOS.impl module. Change-Id: I197aadba2032a30d97a3d9a6698b74aa8709b6f9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quickcontrols2/ios/todolist/HomePage.qml3
-rw-r--r--examples/quickcontrols2/ios/todolist/ProjectPage.qml3
-rw-r--r--examples/quickcontrols2/ios/todolist/SettingsPage.qml3
3 files changed, 3 insertions, 6 deletions
diff --git a/examples/quickcontrols2/ios/todolist/HomePage.qml b/examples/quickcontrols2/ios/todolist/HomePage.qml
index 3d1b29d1d7..94221146e2 100644
--- a/examples/quickcontrols2/ios/todolist/HomePage.qml
+++ b/examples/quickcontrols2/ios/todolist/HomePage.qml
@@ -5,7 +5,6 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.LocalStorage
-import QtQuick.Controls.iOS
Page {
id: root
@@ -57,7 +56,7 @@ Page {
}
Image {
- source: IOS.theme === IOS.Dark ? "images/close-white.png"
+ source: Qt.styleHints.appearance === Qt.Dark ? "images/close-white.png"
: "images/close.png"
width: 20
height: 20
diff --git a/examples/quickcontrols2/ios/todolist/ProjectPage.qml b/examples/quickcontrols2/ios/todolist/ProjectPage.qml
index fd33e73980..a38ad04554 100644
--- a/examples/quickcontrols2/ios/todolist/ProjectPage.qml
+++ b/examples/quickcontrols2/ios/todolist/ProjectPage.qml
@@ -4,7 +4,6 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
-import QtQuick.Controls.iOS
Page {
id: root
@@ -160,7 +159,7 @@ Page {
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
icon.source: "images/close.png"
- icon.color: IOS.theme === IOS.Dark ? "white" : "black"
+ icon.color: Qt.styleHints.appearance === Qt.Dark ? "white" : "black"
onClicked: {
Database.deleteTask(taskList.taskId)
diff --git a/examples/quickcontrols2/ios/todolist/SettingsPage.qml b/examples/quickcontrols2/ios/todolist/SettingsPage.qml
index 85e8ed2125..4d2d7bef9f 100644
--- a/examples/quickcontrols2/ios/todolist/SettingsPage.qml
+++ b/examples/quickcontrols2/ios/todolist/SettingsPage.qml
@@ -3,7 +3,6 @@
import QtQuick
import QtQuick.Controls
-import QtQuick.Controls.iOS
Page {
title: "settingsPage"
@@ -53,7 +52,7 @@ Page {
required property string page
Image {
- source: IOS.theme === IOS.Dark ? "images/back-white.png"
+ source: Qt.styleHints.appearance === Qt.Dark ? "images/back-white.png"
: "images/back.png"
width: 20
height: 20