TreeView CSS Bug

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
1 post • Page 1 of 1
dbindernagel
Posts: 151
Joined: Mon Feb 23, 2015 1:34 pm

TreeView CSS Bug

Post by dbindernagel »

Dear All,

I have encountered some problems regarding using CSS to style the TreeView Widget. Maybe someone can help or has an idea why the problems appear.

1. Problem: Applying CSS to a widget changes more properties than expected.
1.1 I place a TREE widget on a panel and in a script I add some columns and items.
1.2 I apply the following CSS to the ".styleSheet" property of the object.

Code: Select all

QTreeView
{
  color: oa-color(_WindowText);
}
Since the color is already "_WindowText" this should not change anything.

Result: The height of the lines gets bigger. Not sure exactly what gets changed but the items take now more space on the screen.
It seem as if some extra styling gets applied to the Tree View.

2. Problem: Styling the "::item" sub-control is only possible if the QTreeView object is also changed.
2.1 I place a TREE widget on a panel and in a script I add some columns and items.
2.2 I apply the following CSS to the ".styleSheet" property of the object.

Code: Select all

QTreeView::item:hover
{
  background-color: blue;
}
Result: Nothing happens. The hover effect is not applied to the widget.
2.3 I apply the following CSS to the ".styleSheet" property of the object.

Code: Select all

QTreeView
{
  color: oa-color(_WindowText);
}
QTreeView::item:hover
{
  background-color: blue;
}
Result: Now the hover effect gets applied to the widget.
(Changing the color is only an example. Any valid CSS for the QTreeView will trigger the effect.)

Remarks:
  • Version: WinCC OA 3.18 P012 (Qt 5.15.8)
  • Using "TreeWidgetQT" instead of "QTreeView" does not change anything.
  • I do not have any stylesheet.css file in my project (only the one from the installation folder).
Thank You

BR
Dennis

Post Reply
1 post • Page 1 of 1