aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2022-01-21 07:23:08 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2022-01-24 13:25:13 +0100
commitf9834fa3c7aaf64450dca4bd3d1e0208eb021cf3 (patch)
treef0d0ffda5bfc141bdbc27dfc13ee17d9bedf4f63 /examples/quickcontrols2
parenta43912865e294f2014f03eb7073ecd9ecf387623 (diff)
Disambiguate "parent" in flatstyle example
Amends d7862eac1b09f9fb28e540970d5cc98cb6479c52 "rectangle" wasn't a good name for the circular knob part of the switch. By using a more unique name "nub" we can make it a bit easier to read and avoid using "parent" at all. https://en.wiktionary.org/wiki/nub Fixes: QTBUG-100110 Pick-to: 6.3 Change-Id: I428dc6d8463af4ea7e5890145fd40590fed4bcbe Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples/quickcontrols2')
-rw-r--r--examples/quickcontrols2/flatstyle/imports/Flat/Switch.qml10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/quickcontrols2/flatstyle/imports/Flat/Switch.qml b/examples/quickcontrols2/flatstyle/imports/Flat/Switch.qml
index 783fae3abc..51bb388c87 100644
--- a/examples/quickcontrols2/flatstyle/imports/Flat/Switch.qml
+++ b/examples/quickcontrols2/flatstyle/imports/Flat/Switch.qml
@@ -78,7 +78,7 @@ T.Switch {
border.color: Theme.lightGray
Rectangle {
- id: rectangle
+ id: nub
width: Theme.baseSize * 2.6
height: Theme.baseSize * 2.6
@@ -101,7 +101,7 @@ T.Switch {
color: Theme.mainColor
border.color: Theme.mainColor
}
- rectangle.x: parent.width - width
+ nub.x: switchHandle.width - nub.width
}
},
@@ -110,7 +110,7 @@ T.Switch {
when: !control.checked && control.down
PropertyChanges {
- rectangle.color: Theme.light
+ nub.color: Theme.light
}
},
@@ -120,8 +120,8 @@ T.Switch {
when: control.checked && control.down
PropertyChanges {
- rectangle {
- x: parent.width - width
+ nub {
+ x: switchHandle.width - nub.width
color: Theme.light
}
switchHandle {