QT-TableWidget样式设置,带表头和行头复选框

1、样式设置代码:

void Widget::initWidgetDel()
{
    int width = QGuiApplication::screens().at(0)->geometry().width() - 200;
    ui->tableWidgetDel->setStyleSheet(
        "color:#FFFFFF;"
        "gridline-color:gray;"
        "background:rgb(210,210,210);"
        "selection-color:red;"
        "selection-background-color:#20C820;"
        "border:1px solid gray;"
        );
    //设置表头背景色
    ui->tableWidgetDel->horizontalHeader()->setStyleSheet("QHeaderView::section{background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #0973AB,stop:1 #098DCE);color: #ABD6FF;padding-left: 4px;border: 1px solid #383838;}");
    ui->tableWidgetDel->verticalHeader()->setStyleSheet("QHeaderView::section{background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #0973AB,stop:1 #098DCE);color: rgb(210,210,210);;padding-left: 4px;border: 1px solid #383838;}");

    ui->tableWidgetDel->horizontalScrollBar()->setStyleSheet("QScrollBar{background

你可能感兴趣的:(QT)