当前位置: 代码迷 >> QT开发 >> QTabWidget的第二个tab如何设置sheetStyle?
  详细解决方案

QTabWidget的第二个tab如何设置sheetStyle?

热度:24   发布时间:2016-04-25 04:01:27.0
QTabWidget的第二个tab怎么设置sheetStyle???


如上图所示,第一个tab可以设置图片,第三个tab也可以设置,但第二tab个不知道怎么设置。下面是设置sheetStyle的语句,设置第一个tab用了first,第三个tab用last,但第二个用second不行啊。
    m_pTabWidget->setStyleSheet("\
                QTabBar::tab\
                {\
                    width:50px;\
                    height:25px;\
                }\
                QTabBar::tab:first:selected\
                {\
                            background-image:url(:/image/Operater_MouseDown.png);\
                }\
                QTabBar::tab:first:!selected\
                {\
                            background-image:url(:/image/Operater_Normal.png);\
                }\
                QTabBar::tab:first:hover\
                {\
                            background-image:url(:/image/Operater_Hover.png);\
                }\
                QTabBar::tab:last:selected\
                {\
                            background-image:url(:/image/Extend_MouseDown.png);\
                }\
                QTabBar::tab:last:!selected\
                {\
                            background-image:url(:/image/Extend_Normal.png);\
                }\
                QTabBar::tab:last:hover\
                {\
                            background-image:url(:/image/Extend_Hover.png);\