2017-05-04 50 views

回答

1

樣式表下面將圖片添加到所有標籤頁的左側,而不是單獨的標籤。但是,您很可能需要調整CSS中的其他屬性來優化最終結果。

QTabWidget > QTabBar { 
    background: url(url-to-your-corner-image); 
    background-repeat: norepeat; 
    margin-top: 10px; /* whatever needed to center the image vertically */ 
} 
QTabWidget > QTabBar::tab:first { 
    margin-left: 10px; /* at least the width of your image */ 
} 
+0

thanks.it幫了我很多:) –

-1

你可以用一個固定的樣式表中添加第一個標籤:TabWidget stylesheet example

+1

問題不在於將圖標添加到選項卡,而是添加到QTabWidget。 – sithereal

+0

@sithereal是的,我讀得太快了,對不起;) –

相關問題