一、参考文章:http://bbs.csdn.net/topics/390632657?page=1

setStyleSheet("QTabWidget::pane{border-width:1px;border-color:rgb(48, 104, 151);\
                                    border-style: outset;background-color: rgb(132, 171, 208);\
                                    background: transparent;} \
QTabWidget::tab-bar{border-width:0px;}\
QTabBar::tab{border-bottom-color: #C2C7CB;\
             border-top-left-radius: 0px;\
             border-top-right-radius: 0px;\
             max-width: 75px; min-width:75px; min-height:25px;\
             font:14px Times New Roman;\
                 padding: 0px;\
                 }\
QTabBar::scroller {\
                   width:25;\
                       border:0;\
                           padding: 0px;\
                           }\
QTabBar QToolButton::right-arrow {\
                                  background-color:rgb(132, 171, 208);\
                                  border-width: 0;\
                                  background-image: url(:/images/tab/rightbtn.png);\
                              }\
QTabBar QToolButton::right-arrow:hover {\
                                        background-color:rgb(132, 171, 208);\
                                        border-width: 0;\
                                        background-image: url(:/images/tab/hoverrightbtn.png);\
                                    }\
QTabBar QToolButton::right-arrow:disabled {\
                                        background-color:rgb(132, 171, 208);\
                                        border-width: 0;\
                                        background-image: url(:/images/tab/grayrightbtn.png);\
                                    }\
QTabBar QToolButton::left-arrow {\
                                 background-color:rgb(132, 171, 208);\
                                 border-width: 0;\
                                 background-image: url(:/images/tab/leftbtn.png);\
                             }\
QTabBar QToolButton::left-arrow:hover {\
                                       background-color:rgb(132, 171, 208);\
                                       border-width: 0;\
                                       background-image: url(:/images/tab/hoverleftbtn.png);\
                                   }\
QTabBar QToolButton::left-arrow:disabled {\
                                       background-color:rgb(132, 171, 208);\
                                       border-width: 0;\
                                       background-image: url(:/images/tab/grayleftbtn.png);\
                                   }\
QTabBar::tab:first:selected {\
                             margin-left: 30; margin-right: 0;\
                             color: white;\
                                 border-image: url(:/images/tab/sel3.png);\
                             }\
QTabBar::tab:first:!selected {\
                              color: black;\
                                  margin-left: 30; margin-right: 0;\
                                  border-image: url(:/images/tab/normal3.png);\
                              }\
QTabBar::tab:first:hover:!selected {\
                                    color: black;\
                                        margin-left: 30; margin-right: 0;\
                                        border-image: url(:/images/tab/hover3.png);\
                                    }\
QTabBar::tab:middle:selected {\
                              margin-top: 0; margin-left: -15; margin-right: 8;\
                              color: white;\
                                  border-image: url(:/images/tab/sel3.png);\
                              }\
QTabBar::tab:middle:!selected {\
                               color: black;\
                                   margin-top: 0; margin-left: -15; margin-right: 8;\
                                   border-image: url(:/images/tab/normal3.png);\
                               }\
QTabBar::tab:middle:hover:!selected {\
                                     color: black;\
                                         margin-top: 0; margin-left: -15; margin-right: 8;\
                                         border-image: url(:/images/tab/hover3.png);\
                                     }\
QTabBar::tab:last:selected {\
                            margin-top: 0px; margin-left: 0; margin-right: 0;\
                            color: white;\
                                border-image: url();\
                            }\
QTabBar::tab:last:!selected {\
                             color: black;\
                                 margin-top: 0; margin-left: 0; margin-right: 0;\
                                 border-image: url();\
                             }\
QTabBar::tab:last:hover:!selected {\
                                   color: black;\
                                       margin-top: 0; margin-left: 0; margin-right: 0;\
                                       border-image: url();\
                                   }\
QTabBar::tab:only-one {\
                       margin: 0;\
                       }");
tab标签的长度,也需要重载QTabBar来动态计算。

二、设置QTabwidget的TabBar的样式1

QString tabBarStyle = "QTabBar::tab {min-width:100px;color: white;border: 2px solid;border-top-left-radius: 10px;border-top-right-radius: 10px;padding:5px;}\
QTabBar::tab:!selected {margin-top: 5px;} \
QTabBar::tab:selected {color: blue;}";
m_TabWidget->setStyleSheet(tabBarStyle);

三、设置QTabwidget的TabBar的样式2

QTabWidget::pane{
	border:none;
}
QTabWidget::tab-bar{
        alignment:left;
}
QTabBar::tab{
	background:transparent;
	color:white;
	min-width:30ex;
	min-height:10ex;
}
QTabBar::tab:hover{
	background:rgb(255, 255, 255, 100);
}
QTabBar::tab:selected{
	border-color: white;
	background:white;
	color:green;
}

http://blog.csdn.net/libaineu2004/article/details/39829749

 

QTabWidget添加自定义样式的更多相关文章

  1. 修改AspNetPager的CustomInfoHTML,添加自定义样式

    AspNetPager控件有一个属性叫CustomInfoHTML,可以把它写在前台页面,如下: <webdiyer:AspNetPager ID=" HorizontalAlign= ...

  2. jquery validate自定义checkbox验证规则和样式

    参考:http://blog.csdn.net/xh16319/article/details/9987847 自定义checkbox验证,“检查checkbox是否选中” jQuery.valida ...

  3. (ASP.Net)MVC4怎么设置@Html.TextBoxFor样式

    添加自定义样式和属性: @Html.TextBoxFor(s=>s.dd,new {@class="main",@style="width: 100px;" ...

  4. Sharepoint 2013内容查询Web部件自定义显示样式(实战)

    分享人:广州华软 星尘 一. 前言 在进行Sharepoint开发时,经常会遇到内容展示个性化需求的问题,当然如果通过自定义开发控件对于内容展示的需求基本都可以很好的解决,但自定义开发也有不好的地方, ...

  5. 【JavaFx教程】第四部分:CSS 样式

    第4部分主题 CSS样式表 添加应用程序图标 CSS样式表 在JavaFX中,你能使用层叠样式表修饰你的用户接口.这非常好!自定义Java应用界面从来不是件简单的事情. 在本教程中,我们将创建一个*D ...

  6. zTree自定义节点name显示样式

    //setting中配置属性 view: { showLine:false, dblClickExpand: true, showIcon: false, addDiyDom: addDiyDom / ...

  7. Android:系统自定义鼠标样式切换

    一.APP通过View修改鼠标样式 app view上修改鼠标样式比较简单,通过 hover event 获取鼠标坐标并使用如下方法修改为自定义图片: getWindow().getDecorView ...

  8. Cesium入门9 - Loading and Styling Entities - 加载和样式化实体

    Cesium入门9 - Loading and Styling Entities - 加载和样式化实体 Cesium中文网:http://cesiumcn.org/ | 国内快速访问:http://c ...

  9. 分页插件--根据Bootstrap Paginator改写的js插件

    刚刚出来实习,之前实习的公司有一个分页插件,和后端的数据字典约定好了的,基本上是看不到内部是怎么实现的,新公司是做WPF的,好像对于ASP.NET的东西不多,导师扔了一个小系统给我和另一个同事,指了两 ...

随机推荐

  1. cf498C Array and Operations

    C. Array and Operations time limit per test 1 second memory limit per test 256 megabytes input stand ...

  2. HDU_2031——十进制转换成R进制

    Problem Description 输入一个十进制数N,将它转换成R进制数输出.   Input 输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(2<=R<=1 ...

  3. HTML5迷你游戏作验证码

    验证码最常见的是各种变形的字符,因为识别程序进化得越来越聪明,验证码也变得越来越难以识别,给用户造成了很多的麻烦和反感. 已经有很多人尝试过各种改进的验证码,比如动画的验证码,做题目的验证码,要回答问 ...

  4. Beanstalkd介绍

    特征 优先级:任务 (job) 可以有 0~2^32 个优先级, 0 代表最高优先级,beanstalkd 采用最大最小堆 (Min-max heap) 处理任务优先级排序, 任何时刻调用 reser ...

  5. PHP各版本之间差异

    PHP5.3 __toString 魔术方法不再接受参数. 魔术方法 __get, __set, __isset, __unset, and __call 应该总是公共的(public)且不能是静态的 ...

  6. 【自由谈】城域网IPv6过渡技术——4v6场景技术总结(1)

    为什么会存在4v6应用场景?主要是从“云-管-端”的IPv6状态决定的,“云”侧IPv4类业务丰富,IPv6驱动力小,所以“云”在较长一段时间内还是以IPv4类业务为主.“管”侧的IPv6化程度高,设 ...

  7. lession2:使用HTTP Cookie 管理器来传递cookies值

    在实际进行压力测试的时候,经常会出现使用cookie传递值的情况,此时就需要使用[HTTP Cookie 管理器]来传递cookie值. 1.参照lession1中,创建线程组.sampler及聚合报 ...

  8. Server Job: error: String or binary data would be truncated. The statement has been terminated.

    "String or binary data would be truncated. The statement has been terminated" most probabl ...

  9. VB.NET入门基础

    众所周知,Visual Basic.NET是由Visual Basic发展而来,这两者之间的升级使得Visual Basic语言发生了革命性的变革,使得由基于对象编程的Visual Basic过渡到了 ...

  10. iOS中block实现的探究

    [0. Brief introduction of block] Block是iOS4.0+ 和Mac OS X 10.6+ 引进的对C语言的扩展,用来实现匿名函数的特性. 用维基百科的话来说,Blo ...