Results 1 to 7 of 7

Thread: The height of QTreeWidgetItem

  1. #1
    Join Date
    Jan 2006
    Location
    Russia
    Posts
    50
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default The height of QTreeWidgetItem

    Hi,
    Can anyone tell me how I could read an item height of the tree widget?

  2. #2
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: The height of QTreeWidgetItem

    Check out QTreeWidgetItem::sizeHint ().

  3. #3
    Join Date
    Jan 2006
    Location
    Russia
    Posts
    50
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: The height of QTreeWidgetItem

    Quote Originally Posted by Chicken Blood Machine
    Check out QTreeWidgetItem::sizeHint ().
    well, also how I can change the height of the item? I have studied many Mb Qt's documentation but could not find it .

  4. #4
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: The height of QTreeWidgetItem

    Quote Originally Posted by Mad Max
    well, also how I can change the height of the item? I have studied many Mb Qt's documentation but could not find it .
    Try overriding QTreeView::indexRowSizeHint().
    Save yourself some pain. Learn C++ before learning Qt.

  5. #5
    Join Date
    Jan 2006
    Location
    Russia
    Posts
    50
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: The height of QTreeWidgetItem

    Quote Originally Posted by Chicken Blood Machine
    Try overriding QTreeView::indexRowSizeHint().
    Unfortunately it is the protected, non virtual method. I solved it. Just has reimplemented the sizeHint() method at delegate. Thanks nonetheless.

  6. #6
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: The height of QTreeWidgetItem

    Quote Originally Posted by Mad Max
    Unfortunately it is the protected, non virtual method. I solved it. Just has reimplemented the sizeHint() method at delegate. Thanks nonetheless.
    Ah yes, it is non-virtual. I didn't notice that.
    Save yourself some pain. Learn C++ before learning Qt.

  7. #7
    Join Date
    Jun 2008
    Location
    Boulder, Colorado, USA
    Posts
    70
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: The height of QTreeWidgetItem

    The height of the result of this QTreeWidget method, called with a given QTreeWidgetItem, does the trick (for QTreeWidget — this isn’t usable for QTreeView, of course):

    QRect QTreeWidget::visualItemRect (const QTreeWidgetItem* item) const;

Similar Threads

  1. Same height for QComboBox and QPushButton
    By cevou in forum Qt Programming
    Replies: 5
    Last Post: 12th May 2012, 08:56
  2. Custom QTreeWidgetItem context menu?
    By AaronMK in forum Qt Programming
    Replies: 4
    Last Post: 1st February 2010, 05:42
  3. QLayout: different SizeConstraints for width and height?
    By PhilippB in forum Qt Programming
    Replies: 0
    Last Post: 23rd February 2009, 17:33
  4. How can I get the Systray height ?
    By Nyphel in forum Qt Programming
    Replies: 3
    Last Post: 12th March 2007, 10:04
  5. height()
    By mickey in forum Newbie
    Replies: 1
    Last Post: 22nd March 2006, 21:32

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.