Table model colors
14 Jul 2021 01:23 #214663
by persei8
Table model colors was created by persei8
The current tool and offset tables have highlight and selected colors that do not play nice with my current stylesheet. I modified the code so I could set the highlight and selected colors from the handler.It could also be a designer parameter (thus no handler code mods), if you decide to incorporate this change,
Thank you.
def highlight(self, color):
self.tablemodel._highlightcolor = QColor(color)
def selected(self, color):
self.tablemodel._selectedcolor = QColor(color)
Thank you.
Please Log in or Create an account to join the conversation.
14 Jul 2021 03:13 #214670
by cmorley
Replied by cmorley on topic Table model colors
Thanks Jim.
I added your functions and added the properties too.
I also did the same for originoffsetview.
so you can call the functions with a color string:or
set the property with a QColor object :or
set in designer or
set with stylesheet.
Chris
I added your functions and added the properties too.
I also did the same for originoffsetview.
so you can call the functions with a color string:
self.w.tooloffsetview.highlight('red')
set the property with a QColor object :
self.w.tooloffsetview.setProperty('styleColorHighlight',QColor('red'))
set in designer or
set with stylesheet.
#tooloffsetview{
qproperty-styleColorSelection: orange;
qproperty-styleColorHighlight: pink;
}
#offset_table{
qproperty-styleColorHighlight: pink;
}
Chris
The following user(s) said Thank You: persei8
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.115 seconds