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

2012年(13)

2010年(95)

分类: C/C++

2010-12-15 13:43:15

  下面是对工具条的一些选项进行定制
 
          QToolBar {
         background: red;
         spacing: 3px; /* spacing between items in the tool bar */
     }
 
     QToolBar::handle {
         image: url(handle.png);  //可以设置工具条的背景图片
     } 
 
 定制QToolBox
 
     将使用到 tab  的子控部分
 
            QToolBox::tab {
         background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                     stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
                                     stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
         border-radius: 5px;
         color: darkgray;
     }
 
     QToolBox::tab:selected { /* italicize selected tabs */
         font: italic;
         color: white;
     }
 
 
 定制QToolButton
 
     QToolButton { /* all types of tool button */
         border: 2px solid #8f8f91;
         border-radius: 6px;
         background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                           stop: 0 #f6f7fa, stop: 1 #dadbde);
     }
 
     QToolButton[popupMode="1"] { /* only for MenuButtonPopup */
         padding-right: 20px; /* make way for the popup button */
     }
 
     QToolButton:pressed {
         background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                           stop: 0 #dadbde, stop: 1 #f6f7fa);
     }
 
     /* the subcontrols below are used only in the MenuButtonPopup mode */
     QToolButton::menu-button {
         border: 2px solid gray;
         border-top-right-radius: 6px;
         border-bottom-right-radius: 6px;
         /* 16px width + 4px for border = 20px allocated above */
         width: 16px;
     }
 
     QToolButton::menu-arrow {
         image: url(downarrow.png);
     }
 
     QToolButton::menu-arrow:open {
         top: 1px; left: 1px; /* shift it a bit */
     }
阅读(4347) | 评论(1) | 转发(0) |
0

上一篇:QTabWidget与QTabBar

下一篇:QTreeView

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

chinaunix网友2010-12-16 14:29:49

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