当前位置:网站首页>Qt:qss custom QSlider instance
Qt:qss custom QSlider instance
2022-07-03 10:53:00 【C and c++ technology blog】
QT:QSS Customize QSlider example
You can set the style of the horizontal slider , As shown below :
QSlider::groove:horizontal {
border: 1px solid #999999;
height: 8px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4);
margin: 2px 0;
}
QSlider::handle:horizontal {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
border: 1px solid #5c5c5c;
width: 18px;
margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */
border-radius: 3px;
}
If you want to change the color of the slider parts before and after the handle , You can use add page and sub page sub controls . for example , For vertical sliders :
QSlider::groove:vertical {
background: red;
position: absolute; /* absolutely position 4px from the left and right of the widget. setting margins on the widget should work too... */
left: 4px; right: 4px;
}
QSlider::handle:vertical {
height: 10px;
background: green;
margin: 0 -4px; /* expand outside the groove */
}
QSlider::add-page:vertical {
background: white;
}
QSlider::sub-page:vertical {
background: pink;
}
边栏推荐
- Large scale e-commerce project - environment construction
- C语言项目:学生成绩系统
- QT:QSS自定义QLineEdit实例
- Bidding website architecture project progress -- Network Security
- Day 7 small exercise
- Mysql5.7 installation and configuration tutorial (Graphic ultra detailed version)
- Leetcode skimming ---35
- Leetcode skimming ---977
- Bid -- service commitment -- self summary
- C language project: student achievement system
猜你喜欢

Unity学习笔记:个人学习项目《疯狂天才埃德加》纠错文档

Que se passe - t - il ensuite pour ceux qui se sont concentrés sur les tests automatisés?

QT:QSS自定义 QScrollBar实例

测试理论概述

QT:QSS自定义 QTabWidget 和 QTabBar实例

QT:QSS自定义QTableView实例

QT:QSS自定义 QTreeView实例

Numpy realizes the classification of iris by perceptron

C project - dormitory management system (1)

2021-09-22
随机推荐
How does MySQL find the latest data row that meets the conditions?
项目组织战略管理
FileNotFoundError: Could not find module ‘... dll‘ (or one of its dependencies).
【吐槽&脑洞】关于逛B站时偶然体验的弹幕互动游戏魏蜀吴三国争霸游戏的一些思考
Bid -- service commitment -- self summary
那些一门心思研究自动化测试的人,后来怎样了?
[combinatorial mathematics] pigeon's nest principle (simple form of pigeon's nest principle | simple form examples of pigeon's nest principle 1, 2, 3)
logstash备份跟踪上报的数据记录
Jupiter notebook changing font style and font size
C language project: student achievement system
. Net core - a queuing system for wechat official account
QT:QSS自定义 QMenuBar实例
Cache routing component
Unity group engineering practice project "the strongest takeaway" planning case & error correction document
Basic theoretical knowledge of software testing -- app testing
QT:QSS自定义 QProgressBar实例
《通信软件开发与应用》
Unity learning notes: online game pixel Adventure 1 learning process & error correction experience
MySql 怎么查出符合条件的最新的数据行?
Hou Jie -- STL source code analysis notes