Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Changing QPalette::Highlight has no effect for QTreeView.
Forum Updated to NodeBB v4.3 + New Features

Changing QPalette::Highlight has no effect for QTreeView.

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yura-vel
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        yura-vel
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • Y Offline
          Y Offline
          yura-vel
          wrote on last edited by
          #4

          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?

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved