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. How to apply different styling to TreeWidget Parent and Child nodes?
Forum Update on Monday, May 27th 2025

How to apply different styling to TreeWidget Parent and Child nodes?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 202 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.
  • T Offline
    T Offline
    Taytoo
    wrote on last edited by
    #1

    Trying to format TreeWidget nodes where Base Nodes/Parents are root level nodes and they may or may not have any children. Ran into following issues:

    1. The base Nodes/Parents need to have Bold fonts: Tried "font-weight: bold;" but it doesn't work?

    2. Want to increase spacing between base Nodes/Parents because they are too close together. Tried "padding: 6x;" and margin but they didn't work?

    3. Want to adjust indendation (left-spacing for each level). Tried adjusting indentation property in QtDesigner, but it moves all nodesto the right, child nodes move much more than parents? Can I set indentation for each level?

    JonBJ 1 Reply Last reply
    0
    • T Taytoo

      Trying to format TreeWidget nodes where Base Nodes/Parents are root level nodes and they may or may not have any children. Ran into following issues:

      1. The base Nodes/Parents need to have Bold fonts: Tried "font-weight: bold;" but it doesn't work?

      2. Want to increase spacing between base Nodes/Parents because they are too close together. Tried "padding: 6x;" and margin but they didn't work?

      3. Want to adjust indendation (left-spacing for each level). Tried adjusting indentation property in QtDesigner, but it moves all nodesto the right, child nodes move much more than parents? Can I set indentation for each level?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Taytoo
      For 1 & 2, I don't know whether stylesheet will work. How did you actually apply the stylesheet to what (show code)? Are you wedded to using stylesheet for this or are you prepared to use delegate style code?

      1 Reply Last reply
      2

      • Login

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