Python Forum
[PyQt] coloring the widget table row
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] coloring the widget table row
#6
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;
}
"""
Reply


Messages In This Thread
coloring the widget table row - by atlass218 - Aug-09-2019, 08:36 PM
RE: coloring the widget table row - by Alfalfa - Aug-10-2019, 12:32 AM
RE: coloring the widget table row - by atlass218 - Aug-10-2019, 05:52 AM
RE: coloring the widget table row - by Alfalfa - Aug-10-2019, 12:22 PM
RE: coloring the widget table row - by atlass218 - Aug-20-2019, 08:10 AM
RE: coloring the widget table row - by Axel_Erfurt - Aug-20-2019, 07:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PyQt Selected row in Table Widget rarevesselt 3 23,689 Dec-07-2018, 07:00 PM
Last Post: rarevesselt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020