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. Styling all of QtreeView...
Forum Updated to NodeBB v4.3 + New Features

Styling all of QtreeView...

Scheduled Pinned Locked Moved Unsolved General and Desktop
qstyleqproxystyleqstylesheetqtreeviewqwidget
3 Posts 2 Posters 881 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 last edited by Dariusz
    #1

    Hey

    So I'm digging into the styling of QtreeView... viewport, items, decorators, all of it.

    As far as I can tell I need QProxyStyle to do background which handles item QRect visual.
    I need setItemDelegate() / QStyledItemDelegate for styling of items them self..

    But out of both of them... neither affects the decorator >
    ec7aa903-523b-4889-8255-cbc40ee123a6-image.png
    How do I affect them? The background color & pixmap/icon/arrow all of it?

    Or I did not override the correct function... Any hints, any1?

    TIA

    Edit1
    I found these 3 places where decorator is mentioned...
    https://code.woboq.org/qt6/qtbase/src/widgets/styles/qstylesheetstyle.cpp.html#5939
    https://code.woboq.org/qt6/qtbase/src/widgets/styles/qcommonstyle.cpp.html#2293
    https://code.woboq.org/qt6/qtbase/src/widgets/styles/qcommonstyle.cpp.html#3151

    Sadly none of them gets called in my style sheet as far as I can tell... mmm syme styleHint() is it as I didnt replace that one yet but its odd...
    Hints any1?

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Any particular reason why you can’t just use a simple stylesheet?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      D 1 Reply Last reply
      0
      • VRoninV VRonin

        Any particular reason why you can’t just use a simple stylesheet?

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

        @VRonin I want to do some heavy changes/customisations... stuff I cant do in CSS...
        Like moving expand button to opposite of tree, changing location of checkbox, changing indentation of child items.

        How can I control indentation of child items? I need it now :/ I keep getting "invisible" hitboxes as my child item is moved to left visually but hitboxes are drawn in original places :///

        Ideas?

        I just realized there is "setIndentation"... sigh............ Ok that kinda works, how can I set indentation per row? :D

        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