How to set initial value of a custom slider in qml?
问题 I am using Qt 5.4.1. I have made a custom slider element to be used in other qml components like so: Slider.qml import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Controls.Styles 1.3 Item { id: root width: 150 height: 30 property int val: slider.value property int maxVal: slider.maximumValue property int minVal: slider.minimumValue property int step: slider.stepSize Slider { id: slider anchors.margins: 20 stepSize: step maximumValue: maxVal minimumValue: minVal style: customStyle /