diff options
author | Vladimir Belyavsky <[email protected]> | 2024-04-11 13:23:45 +0300 |
---|---|---|
committer | Vladimir Belyavsky <[email protected]> | 2024-04-12 18:47:37 +0300 |
commit | f3c7f88daca2643b5bc79944a6bfb23d51d61571 (patch) | |
tree | 94c1eaae0c092287f4f57129324c1fa7574dbc73 | |
parent | cc8126cf660f27a909ad9c50bbf9faee53fa10b7 (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
Pick-to: 6.7
Change-Id: I7916e7e82e4b49e1e13fc484c81e451d384aa812
Reviewed-by: Mitch Curtis <[email protected]>
-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" |