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
QtWS25 Last Chance

QTreeView remove dotted line when selected

Scheduled Pinned Locked Moved Solved General and Desktop
qtreeviewqstyleditemdeleqstylesheet
5 Posts 4 Posters 3.0k Views
  • 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 2 Nov 2019, 14:57 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
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 2 Nov 2019, 16:45 last edited by mrjj 11 Feb 2019, 16:48
      #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 3 Nov 2019, 13:48
      2
      • C Online
        C Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 3 Nov 2019, 09:25 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
        • M mrjj
          2 Nov 2019, 16:45

          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 3 Nov 2019, 13:48 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 16 Jul 2020, 08:38 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