qml学习-------------Slider(滑块)
来源:互联网 发布:javascript封装函数 编辑:程序博客网 时间:2024/05/16 00:56
Slider跟其他的控件一样,可以通过SliderStyle来设置滑块的风格。
import QtQuick 2.2import QtQuick.Controls 1.2import QtQuick.Controls.Styles 1.2Rectangle{ width: 320; height: 240; color: "lightgray"; Row{ anchors.fill: parent; spacing: 20; Column{ width: 200; spacing: 16; Text{ id:sliderStat; color: "blue"; text:"current - 0.1"; } Slider{ width: 200; height: 30; stepSize: 0.01; value: 1; onValueChanged: { sliderStat.text = "current - " + value; } } Slider{ width: 200; height: 30; minimumValue: 0; maximumValue: 100; stepSize: 1; value: 50; tickmarksEnabled: true; } Slider{ id: customGrooveAndHandle; width: 200; height: 30; stepSize: 0.1; tickmarksEnabled: true; value: 0; style: SliderStyle{ groove: Rectangle{ implicitWidth: 200; implicitHeight: 8; color: "gray"; radius: 8; } handle: Rectangle{ anchors.centerIn: parent; color:control.pressed ? "white":"lightgray"; border.color: "gray"; border.width: 2; width: 34; height: 34; radius: 12; } } } Slider{ id: customPanel; width: 200; height: 36; stepSize: 0.1; value: 0; tickmarksEnabled: true; style: SliderStyle{ groove: Rectangle{ implicitWidth: 200; implicitHeight: 8; color: "gray"; radius: 8; } handle: Rectangle{ anchors.centerIn: parent; color: control.pressed ? "white":"lightgray"; border.color: "gray"; border.width: 2; width: 34; height: 34; radius: 12; Text{ anchors.centerIn: parent; text: control.value; 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 * grooveLoader.width)/(control.maximumValue - control.minimumValue) , grooveLoader.width - item.width ); sourceComponent: handle; } } } } } Slider{ width: 30; height: 200; orientation: Qt.Vertical; stepSize: 0.1; value: 0.2; tickmarksEnabled: true; } }}
0 0
- qml学习-------------Slider(滑块)
- Qt-QML-Slider-滑块-Style
- Qt-QML-Slider-滑块-Style-后继
- slider滑块用法
- slider滑块用法
- MFC-Slider(滑块)
- slider滑块
- 7滑块控件Slider
- Qt qml 滑块
- jQuery EasyUI API 中文文档 - 数字滑块(Slider)
- iOS cocos2d实现slider(滑块)控件效果源码
- iOS cocos2d实现slider(滑块)控件效果源码
- jquery UI API-滑块部分(Slider widget)
- QML学习之基本元素ProgressBar, TabView, Slider介绍
- QML 自定义Slider
- 滑块控件 (Slider Control) 样式
- jQuery UI应用--滑块Slider
- WPF中Slider滑块的使用
- Python脚本06 —— 批量上传图片到七牛服务器
- Mybatis List列表In查询实现的注意事项
- Nginx负载均衡配置实例详解
- IOS UICollectionView学习
- 【用户界面:Android-ConvenientBanner】功能演示
- qml学习-------------Slider(滑块)
- 框架Quart在Java中任务调度的使用
- MySQL日期时间函数大全 转
- VS 2005 创建DLL工程,并进行调用与调试例子
- OAF页面上传、导入、发布
- GNU C __attribute__
- Python脚本07 —— 替换模板中的七牛域名
- (乙)1006. 换个格式输出整数
- ElasticSearch分片分布规则配置