Chinaunix首页 | 论坛 | 博客
  • 博客访问: 537003
  • 博文数量: 108
  • 博客积分: 3242
  • 博客等级: 中校
  • 技术积分: 916
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-07 11:46
文章分类
文章存档

2012年(13)

2010年(95)

分类: C/C++

2010-12-15 13:32:40

    下面的横向的slider 
 
    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;
     }
 
 
       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;
     }
阅读(2964) | 评论(1) | 转发(0) |
0

上一篇:QSizeGrip

下一篇:定制QSplitter

给主人留下些什么吧!~~

chinaunix网友2010-12-16 14:26:23

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com