当前位置: 代码迷 >> QT开发 >> QTabWidget上面的TabBar如何添加图片,类似360安全卫士那种的,不是小图标哦
  详细解决方案

QTabWidget上面的TabBar如何添加图片,类似360安全卫士那种的,不是小图标哦

热度:61   发布时间:2016-04-25 03:32:52.0
QTabWidget上面的TabBar怎么添加图片,类似360安全卫士那种的,不是小图标哦
我用到了一个QTabwidget空间,想改变一下上面的tabBar,在里面添加图片,类似360安全卫士那种效果,上面是个大图片,下面有名称。用setTabIcon()只能是一点点小图标。
应该怎么弄呢,非常感谢

------解决方案--------------------
上面的错了,下面的

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);\
  相关解决方案