PDA

View Full Version : The height of QTreeWidgetItem



Mad Max
7th February 2006, 05:33
Hi,
Can anyone tell me how I could read an item height of the tree widget?

Chicken Blood Machine
7th February 2006, 07:39
Check out QTreeWidgetItem::sizeHint ().

Mad Max
16th February 2006, 19:56
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 :( .

Chicken Blood Machine
16th February 2006, 20:32
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().

Mad Max
16th February 2006, 20:45
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.

Chicken Blood Machine
16th February 2006, 22:04
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.

philw
14th May 2013, 06:38
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;