PDA

View Full Version : height property not adjusted when QTreeView item selected



hubbobubbo
22nd April 2010, 14:50
Hi

I have a QTreeView which uses this style sheet:

QTreeWidget::item:selected{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6ea1f1, stop: 1 #567dbc);
height: 60px;
}

My intention was that the row in the QTreeView would not only highlight but also get bigger when it is the selected one. The highlighting above works fine but the height is not changed when the item becomes active.

Using setSizeHint from the code instad increases the size of the row was expected.

Am I missing the point on what stylesheets can be/shold be used for here?

Lykurg
22nd April 2010, 15:38
Personally I don't like style sheets for Qt applications so much. They are nice if you want quickly style the common elements in a program. But not more. All other things (even if they can be accessed with style sheets) should be done in C++. But that's only my personal opinion. I also try to avoid style sheets where ever possible.

Also note, and you have it, that style sheets don't support everything on every widget. To find out what is where supported you have to go carefully through the docs.