Changing QPalette::Highlight has no effect for QTreeView.



  • I want to disable highlighting of QTreeView when user clicks on the widget.
    I tried to use style sheets, but with no success.

    Changing of tree's palette didn't help to:

    @QPalette p( tree->palette() );
    p.setColor( QPalette::Highlight, Qt::transparent );
    tree->setPalette( p );@

    Please, help me to find out how to disable highlighting.
    By the way, the current os - MacOS.


  • Lifetime Qt Champion

    Hi,

    Since you don't want highlighting, I suppose you don't want your model to be selectable ?



  • Why not? I talking about highlighting of the tree widget, not about the tree (model) items.
    For example, in the QtCreator, the project tree is selectable, but there is no highlighted border (may be this called frame) around the tree on selection.



  • Ok, I understand my mistake in the question.
    I have been confused by the image on "this":http://qt-project.org/doc/qt-4.8/qpalette.html#details page.
    I thought, that Highlight is a property of the widget, now I see that arrow pointed on the TEXT highlight.

    The question is - hot to disable "blue frame" around the widget?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.