我现在想让QTabWidget的每个tab都是不一样的图片风格,应该怎么做呢,我的QSS文件如下,应该怎么修改才能实现我的做法呢,谢谢了。
QTabWidget::pane { /* The tab widget frame */
border-top: 2px solid #C2C7CB;
border-bottom: 2px solid #C2C7CB;
border-left: 2px solid #C2C7CB;
border-right: 2px solid #C2C7CB;
}
QTabWidget::tab-bar {
left: 10px; /* move to the right by 5px */
}
QTabBar::tab:first {
border-image:url(:/images/Code.jpg);
border-top-left-radius: 4px;
border-top-right-radius: 4px;
min-width: 20ex;
min-height: 20ex;
padding: 2px;
}
QTabBar::tab:last {
border-image:url(:/images/myfile.jpg);
border-top-left-radius: 4px;
border-top-right-radius: 4px;
min-width: 20ex;
min-height: 20ex;
padding: 2px;
}
QTabBar::tab:selected, QTabBar::tab:hover {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #fafafa, stop: 0.4 #f4f4f4,
stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
}