QTableWidget - Change the row color

前端 未结 1 1517
深忆病人
深忆病人 2021-01-13 22:13

I\'m trying to change the color of background of an QTableWidget. There is some others posts about the same things bot nothing of the given solution worked for me.

相关标签:
1条回答
  • 2021-01-13 22:48

    There is no function that performs this task, but we can create it, for example:

    def setColortoRow(table, rowIndex, color):
        for j in range(table.columnCount()):
            table.item(rowIndex, j).setBackground(color)
    

    0 讨论(0)
提交回复
热议问题