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. Custom QTreeView, row height problem
Qt 6.11 is out! See what's new in the release blog

Custom QTreeView, row height problem

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.3k 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.
  • Gianluca86G Offline
    Gianluca86G Offline
    Gianluca86
    wrote on last edited by
    #1

    Hi everyone,
    I created custom Qtreeview and added it to the Dock.
    The problem is the height of the rows, because if I extend or narrow the dock, the height is always fixed, but I expect the height to increase or decrease depending on the text.
    I've tried with the Delegate's "SizeHint" function, but this is called only when creating Qtreeview.
    Is there a way to dynamically change the height of the rows?
    I hope I explained myself.
    thank you.

    VRoninV 1 Reply Last reply
    0
    • Gianluca86G Gianluca86

      Hi everyone,
      I created custom Qtreeview and added it to the Dock.
      The problem is the height of the rows, because if I extend or narrow the dock, the height is always fixed, but I expect the height to increase or decrease depending on the text.
      I've tried with the Delegate's "SizeHint" function, but this is called only when creating Qtreeview.
      Is there a way to dynamically change the height of the rows?
      I hope I explained myself.
      thank you.

      VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Just reimplement the resizeEvent of the View

      "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

      1 Reply Last reply
      2
      • Gianluca86G Offline
        Gianluca86G Offline
        Gianluca86
        wrote on last edited by
        #3

        Right, I had forgotten that function, now it's perfect, thank you.

        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