Table model colors

More
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.
def highlight(self, color):
    self.tablemodel._highlightcolor = QColor(color)

def selected(self, color):
    self.tablemodel._selectedcolor = QColor(color)
It could also be a designer parameter (thus no handler code mods), if you decide to incorporate this change,
Thank you.

Please Log in or Create an account to join the conversation.

More
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:
self.w.tooloffsetview.highlight('red')
or
set the property with a QColor object :
self.w.tooloffsetview.setProperty('styleColorHighlight',QColor('red'))
or
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.183 seconds
Powered by Kunena Forum