Results 1 to 2 of 2

Thread: Setting SizeHint in QTreeView.

  1. #1
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Setting SizeHint in QTreeView.

    Dear All,

    I am using Qt 4.3.3 on Mac.
    I am using QTreeWidgetItem & QTreeWidget for displaying items.
    Now I am using Model & view programming to show some data on QTreeView.

    In QTreeWidgetItem i have used setSizeHint to set the Item size But I donot know how to do it in QTreeView.

    So please help me out.

    Thanks.
    Vishal

  2. #2
    Join Date
    Jul 2009
    Posts
    139
    Thanks
    13
    Thanked 59 Times in 52 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Setting SizeHint in QTreeView.

    If you are using a custom model, you can return a size hint from your data function when Qt::SizeHintRole is requested. If you are using one of the built in models, you can call setData with Qt::SizeHintRole.

Similar Threads

  1. row height with QTreeView and delegates
    By Philipp in forum Qt Programming
    Replies: 7
    Last Post: 11th November 2008, 10:40
  2. QTableView sizeHint() issues
    By akos.maroy in forum Qt Programming
    Replies: 3
    Last Post: 20th September 2008, 22:42
  3. sizeHint()
    By sm in forum Newbie
    Replies: 11
    Last Post: 22nd January 2008, 03:59
  4. QTreeView help
    By bepaald in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2007, 21:22
  5. paint QTreeView item !!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2006, 14:24

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.