相关文章推荐
小胡子的蛋挞  ·  QTablewidget ...·  1 周前    · 
灰常酷的小马驹  ·  QTableWidget ...·  1 周前    · 
潇洒的猴子  ·  pyqt5 ...·  1 周前    · 
体贴的扁豆  ·  Qt之 QTableWidget ...·  1 周前    · 
绅士的打火机  ·  python QTableWidget序号 ...·  1 周前    · 
一身肌肉的眼镜  ·  Spring ...·  2 月前    · 
坚强的拖把  ·  Postgresql COPY ...·  9 月前    · 
火爆的咖啡  ·  C++ - Vector 计算 ...·  1 年前    · 

QTablewidget样式滚动条表头Qss样式设置

如下图所示设置Qtablewidget样式,表头颜色设置,选中列背景色设置等

QTableWidget
    background: #303033;
QTableWidget::item
    color:rgba(255,255,255,150);
    background: #303033;
    text-align:center;
QTableWidget::item:hover
    color:#FFFFFF;
    background: #4B4B4D;
QTableWidget::item:selected
    color:#FFFFFF;
    background: #4B4B4D;
QHeaderView::section,QTableCornerButton:section
    text-align:center;
    padding:3px; 
    margin:0px; 
    color:#DCDCDC; 
    border:1px solid #242424; 
    border-left-width:0px; 
    border-right-width:1px; 
    border-top-width:0px;
     border-bottom-width:1px; 
    background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #646464,stop:1 #525252);
QHeaderView::section:selected
    color:#FFFFFF; 
    border:1px solid #242424; 
QScrollBar:vertical{ 
    width:8px;  
    border-style:flat;
    border-radius: 4px;
    border:0px;
     background: #19191A;
QScrollBar::handle:vertical{ 
    background: rgba(255,255,255,0.50);
    border-radius: 4px;
    width:8px; 
    min-height:91px; 
    border-style:flat;
QScrollBar::handle:vertical::hover{ 
    background: rgba(255,255,255,0.90);
    border-radius: 4px;
    width:8px; 
QScrollBar::handle:vertical::pressed{ 
    background: rgba(255,255,255,0.90);
    border-radius:4px;
    width:8px; 
QScrollBar::sub-page:vertical {
    background: #19191A;
border-style:flat;
QScrollBar::add-page:vertical {
   background: #19191A;
border-style:flat;
QScrollBar::add-line:vertical{
   background: #19191A;
QScrollBar::sub-line:vertical {
   background: #19191A;
QScrollBar:horizontal{ 
    height:8px;  
    border-style:flat;
    border-radius: 4px;
    border:0px;
background: #19191A;
QScrollBar::handle:horizontal{ 
    background: rgba(255,255,255,0.50);
    border-radius: 4px;
    height:8px; 
    min-width:91px; 
    border-style:flat;
QScrollBar::handle:horizontal::hover{ 
    background: rgba(255,255,255,0.90);
    border-radius: 4px;
    height:8px; 
QScrollBar::handle:horizontal::pressed{ 
    background: rgba(255,255,255,0.90);
    border-radius:4px;
    height:8px; 
QScrollBar::sub-page:horizontal {
    background: #19191A;
    border-style:flat;
QScrollBar::add-page:horizontal {
   background: #19191A;
    border-style:flat;