只有一個窗口小部件類QTableWidget
的圖片表示對話框窗口。我的問題是,底部標題的邊框(紅色正方形,QHeaderView
類)與左/右彩色邊框重疊!我想要的是讓紅色正方形部分正確地顯示爲綠色正方形。如何在標題中繪製正確的CSS邊框?
下面是從Qt Designer
CSS代碼我使用的:
QTableView#tableWidget QHeaderView::section:horizontal
{
height: 24px;
border-style: none;
border-left: 1px solid #ecedef;
border-top: 1px solid #161618;
border-right: 1px solid #b1b1b5;
border-bottom: 1px solid #161618;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #f4f4f6, stop:1 #ceced6);
}
/*
QTableView#tableWidget QHeaderView::section:horizontal:first,
QTableView#tableWidget QHeaderView::section:horizontal:last
{
border-left-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #f4f4f6, stop:1 #ceced6);
}
*/
謝謝!
更新:這裏被放大的畫面,以防萬一......
看起來像一個Qt錯誤 – pnezis 2012-04-05 10:19:31
@webclectic不,我在下面發佈解決方案。 Thnks! – mosg 2012-04-05 10:42:51