- alternate-background-color
交替背景色用于修饰QAbstractItemView的子类,如果这个属性未被设置,默认值为QPalette::AlternateBase 例子:
QTableWidget
{
alternate-background-color: blue;
background: yellow;
}
注意!请先启用交替背景色属性
ui->tableWidget->setAlternatingRowColors(true);
Qt Engineer
交替背景色用于修饰QAbstractItemView的子类,如果这个属性未被设置,默认值为QPalette::AlternateBase 例子:
QTableWidget
{
alternate-background-color: blue;
background: yellow;
}
注意!请先启用交替背景色属性
ui->tableWidget->setAlternatingRowColors(true);