Solved How to get QTreeWidgetItem position?
-
How shall I get a QTreeWidgetItem LeftTop position (in pixel) after I get this item with the itemAt?
-
treeWidget()->itemWidget(poTreeItem,0)->rect().topLeft();
-
The item has no visual representation it's just pure data. It's the view/delegate that takes care of representing visually the item.
Why do you need that position?
-
@VRonin I need the position to define border coordinates of item. And then I will make a height resize of the item (when a mouse cursor drag a border).
It is strange. I can set height of an item with
QSize height; height.setHeight(123); item->setSizeHint(0, height);
But I can not get coordinates of an item.
-
All you are trying to do should be done by subclassing
QStyledItemDelegate
-
treeWidget()->itemWidget(poTreeItem,0)->rect().topLeft();
-
itemWidget
is not the way to go. the delegate is the scalable solution