Aug-20-2019, 07:57 PM
why not using stylesheet?
self.tableWidget_cev_loc35L.setSelectionBehavior (QAbstractItemView.SelectRows) self.tableWidget_cev_loc35L.setStyleSheet(stylesheet(self))stylesheet def:(example)
def stylesheet(self): return """ QTableWidget { background: #e9e9e9; selection-color: white; border: 1px solid lightgrey; selection-background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #8ae234, stop: 1 #4e9a06); color: #202020; outline: 0; } QTableWidget::item::hover{ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #babdb6, stop: 0.5 #d3d7cf, stop: 1 #babdb6); } QTableWidget::item::focus { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #8ae234, stop: 1 #4e9a06); border: 0px; } """