Hi
I have a table with a combobox widget in certain cells. If the selected entry of the embedded combobox matches a certain value, I want to set the cell's background color. How can I achieve this?
Obviously, it does not work with table.cellBackColRC(), probably because the widget is displayed on top.
Thank you in advance
Tobias
set background color in a table.cellWidgetRC, type ComboBox
- weirdal
- Posts:34
- Joined: Thu Mar 12, 2015 11:37 am
set background color in a table.cellWidgetRC, type ComboBox
- weirdal
- Posts:34
- Joined: Thu Mar 12, 2015 11:37 am
Re: set background color in a table.cellWidgetRC, type ComboBox
Code: Select all
if (g_dsSelectedTypes.at(i).isEmpty())
{
tabDpSelection.styleSheet(getStylesheet());
}
[...]
private string getStylesheet()
{
return "QTableView QComboBox\n" +
"{\n" +
" background-color: red;\n" +
"}";
}- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: set background color in a table.cellWidgetRC, type ComboBox
It looks like you can either use a widget in a table cell or do a coloring.
Combining both options is not possible.
Best Regards
Leopold Knipp
Senior Support Specialist
Combining both options is not possible.
Best Regards
Leopold Knipp
Senior Support Specialist