Results 1 to 3 of 3

Thread: QTreeView height issue

  1. #1
    Join Date
    Apr 2013
    Posts
    64
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default QTreeView height issue

    I am using QTreeView and QStandardItemModel. I am inserting the QTreeView inside a Widget Thru QGridLayout. I want the Tree View to be expanded when the parent widget is expanded. I tried with Size policy, resetSize, etc. But nothing worked. In-fact it expands horizontally as expected. But the Height is expanded to a limit and then stops after a limit. This happens even when the contents are much bigger than available area. How to solve this?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTreeView height issue

    Demo app with the issue?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Apr 2013
    Posts
    64
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTreeView height issue

    The question is very simple. How to make the QTreeView (white area) always touch its parents borders irrespective of content size? I am using grid layout. First row of the layout contains a button of fixed height. I am Adding QTreeview in second row. I am using "preferred" policy (I almost tried all combinations) for both parent and tree. Now when I increase the height of parent widget, the height for tree view also increase for some time as expected (The scroll bar appears if content size more irrespective of expanding-good). But after some time it stops expanding and instead moves downward along with bottom border of parent leaving a gap between button (which is in the first row of grid) and tree (which is in the second row of the grid). I have tried setMaximumHeight for tree, but not worked

Similar Threads

  1. Row Height Resizing with QAbstractItemModel & QTreeView
    By dempsey001 in forum Qt Programming
    Replies: 0
    Last Post: 18th August 2011, 18:20
  2. row height with QTreeView and delegates
    By Philipp in forum Qt Programming
    Replies: 7
    Last Post: 11th November 2008, 10:40
  3. row height in QTreeView and QTableView
    By yuriry in forum Qt Programming
    Replies: 2
    Last Post: 9th October 2008, 00:58
  4. How to determine the header row height in QTreeView
    By ghorwin in forum Qt Programming
    Replies: 3
    Last Post: 20th September 2007, 19:39
  5. setting row height in QTreeView?
    By gfunk in forum Qt Programming
    Replies: 3
    Last Post: 28th July 2006, 00:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.