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. QTreeView remove dotted line when selected
Forum Updated to NodeBB v4.3 + New Features

QTreeView remove dotted line when selected

Scheduled Pinned Locked Moved Solved General and Desktop
qtreeviewqstyleditemdeleqstylesheet
5 Posts 4 Posters 3.1k 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.
  • D Offline
    D Offline
    Dariusz
    wrote on last edited by
    #1

    Hey

    Does any1 know how to control it/remove it? Style/function/paint event?

    Regards
    Dariusz

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

      Hi
      It can be removed with (maybe) stylesheet or delegate

      https://forum.qt.io/topic/18888/how-to-remove-focus-rectangle-on-qlistview-and-similar-using-qstyleditemdelegate-with-style-sheets

      See SeitsemaN post how the delegate could look.

      D 1 Reply Last reply
      2
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        You have to clear State_HasFocus somehow. The easiest way I see is to create a proxy style which removes this flag before passing it to drawControl.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0
        • mrjjM mrjj

          Hi
          It can be removed with (maybe) stylesheet or delegate

          https://forum.qt.io/topic/18888/how-to-remove-focus-rectangle-on-qlistview-and-similar-using-qstyleditemdelegate-with-style-sheets

          See SeitsemaN post how the delegate could look.

          D Offline
          D Offline
          Dariusz
          wrote on last edited by
          #4

          @mrjj said in QTreeView remove dotted line when selected:

          SeitsemaN

          Worked like charm, thanks!

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sadeep
            wrote on last edited by
            #5

            Thanks @SeitsemaN for this solution,
            *{outline: none;}

            This works well. I wasted like 8hrs on this.

            1 Reply Last reply
            1

            • Login

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