How can I set QTableWidget header item background color to initial value?



  • I change background color of QTableWidget horizontal header item to red with this code:

    ui->tbl->horizontalHeaderItem(0)->setBackgroundColor(Qt::red);

    After that I want to set color to initial value. How can I do that ?

    I tried to get initial value with ui->tbl->horizontalHeaderItem(0)->setBackgroundColor() but it returns QColor(invalid).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.