Commit 40830295 authored by Marco Martin's avatar Marco Martin Committed by Noah Davis
Browse files

use Templates.RangeSlider to not crash

at this point, the parent control is not really an instance of
Controls.RangeSlider but rather Templates.RangeSlider.
checking for Controls.RangeSlider crashes for a Qt bug
but changing to Templates fixes the crash

(cherry picked from commit 9646ca04)
parent cb602961
......@@ -5,16 +5,17 @@
import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Templates 2.15 as Templates
import org.kde.kirigami 2.14 as Kirigami
Rectangle {
id: root
property alias control: root.parent
property Templates.Control control
property real startPosition: isRangeSlider ? control.first.position : 0
property real endPosition: isRangeSlider ? control.second.position : control.position
readonly property bool isRangeSlider: control instanceof Controls.RangeSlider
readonly property bool isRangeSlider: control instanceof Templates.RangeSlider
readonly property real handleWidth: isRangeSlider ? control.first.handle.width ?? 0 : control.handle.width ?? 0
readonly property real handleHeight: isRangeSlider ? control.first.handle.height ?? 0 : control.handle.height ?? 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment