I am trying to customize Slider
QML Component but getting error for style
property.
I want to make the slider handle
smaller and also change some colors and so on, so I am trying to modify the style.
I found different behavior with multiple versions of the QtQuick.Controls
.
import QtQuick 2.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls 1.4
Rectangle {
property int slideFrom: 0
property int slideTo: 10
property int slideStep: 1
property int slideValue: 0
Slider {
width: 100
height: 50
snapMode: Slider.SnapAlways
from: parent.slideFrom
to: parent.slideTo
stepSize: parent.slideStep
value: parent.slideValue
style: SliderStyle {
}
}
}
If I import QtQuick.Controls 2.14
I get Error for style property as "Invalid property name style".
If I import QtQuick.Controls 1.4
I get error for snapMode
, from
and to
as "Invalid property name".
I want both the properties and I see issue with imports.
I have no idea if we don't have to
, from
and stepSize
in older version how we can manage the slide or is there some different way of using it?