代码拉取完成,页面将自动刷新
import QtQuick 2.0
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
Rectangle {
id: root;
width: parent.width;
height: 20;
color: "transparent"
property alias slideValue: customPanel.value;
signal slideChanged;
Slider {
id: customPanel;
width: 240;
height: 20;
x: (parent.width - width) / 2;
stepSize: 0.2;
value: 1.5;
minimumValue: 0.2;
maximumValue: 4;
tickmarksEnabled: false;
onValueChanged: {
root.slideChanged();
}
style: SliderStyle {
groove: Rectangle {
implicitWidth: 240;
implicitHeight: 8;
color: "gray";
radius: 8;
}
handle: Rectangle {
anchors.centerIn: parent;
color: control.pressed ? "white" : "lightgray";
border.color: "gray";
border.width: 2;
width: 28;
height: 28;
radius: 8;
Text {
anchors.centerIn: parent;
text: control.value.toFixed(1);
color: "red";
}
}
panel: Rectangle {
anchors.fill: parent;
radius: 4;
color: "lightsteelblue";
Loader {
id: grooveLoader;
anchors.centerIn: parent;
sourceComponent: groove;
}
Loader {
id: handleLoader;
anchors.verticalCenter: grooveLoader.verticalCenter;
x: Math.min(grooveLoader.x + ((control.value - control.minimumValue) * grooveLoader.width) / (control.maximumValue - control.minimumValue), grooveLoader.width - item.width);
sourceComponent: handle;
}
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。