Results 1 to 3 of 3

Thread: QTreeView automatic Widget Height adjustment

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

    Default QTreeView automatic Widget Height adjustment

    I am creating QTreeView with QStandardDataModel. The Height if the widget seems to be bigger than needed. How to fix it? Also I would like to edit the height of TreeView dynamically so that it is just enough to fit the current data / expansion state. Please help

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeView automatic Widget Height adjustment

    Also I would like to edit the height of TreeView dynamically so that it is just enough to fit the current data / expansion state
    It wont be a good idea. TreeView will be inherited from scroll area and will provide a scroll bar if the height of items is more than the height of the view.

    You might try playing with QStandardItem::sizeHint

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

    Default Re: QTreeView automatic Widget Height adjustment

    It will not be good when the contents are more. My problem is that, it comes with lot of blank area even though the contents are less. I want to avoid that space initially.When someone expands the view should become bigger upto a limit and then it scroll bar should appear.

Similar Threads

  1. Dymanic setting row height in a QTreeView
    By fruzzo in forum Qt Programming
    Replies: 0
    Last Post: 15th September 2011, 14:49
  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.