diff options
author | Vladimir Belyavsky <belyavskyv@gmail.com> | 2024-04-11 13:23:45 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-04-12 22:14:36 +0000 |
commit | 9029a92fb3b27f2cbaf8156e41ece62c423a7fc3 (patch) | |
tree | 3c42882ef93e5b535310a99ef895e3e0c4868ace | |
parent | 3ee9488de0455292f91043efbfd91ba84d39d326 (diff) |
iOS: fix warnings in Slider in case of null handle
Fix warnings, such as "TypeError: Cannot read property 'width' of null"
in case when the handle is null
Fixes: QTBUG-124290
Change-Id: I7916e7e82e4b49e1e13fc484c81e451d384aa812
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit f3c7f88daca2643b5bc79944a6bfb23d51d61571)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quickcontrols/ios/Slider.qml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quickcontrols/ios/Slider.qml b/src/quickcontrols/ios/Slider.qml index fe76303e26..efa196bc72 100644 --- a/src/quickcontrols/ios/Slider.qml +++ b/src/quickcontrols/ios/Slider.qml @@ -53,7 +53,9 @@ T.Slider { } NinePatchImage { - width: control.handle.width / 2 + control.position * (parent.width - control.handle.width) + readonly property real handleWidth: control.handle ? control.handle.width : 0 + + width: handleWidth / 2 + control.position * (parent.width - handleWidth) height: parent.height source: IOS.url + "slider-progress" |