7 Star 3 Fork 1

wjzhe / mapEditor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ScaleSlide.qml 1.94 KB
一键复制 编辑 原始数据 按行查看 历史
wjzhe 提交于 2017-02-09 17:24 . 文件格式转为UTF-8
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;
}
}
}
}
}
C++
1
https://gitee.com/null_446_4477/mapeditor.git
git@gitee.com:null_446_4477/mapeditor.git
null_446_4477
mapeditor
mapEditor
master

搜索帮助