Qt 6.11 is out! See what's new in the release
blog
How to get QTreeWidgetItem position?
-
How shall I get a QTreeWidgetItem LeftTop position (in pixel) after I get this item with the itemAt?
-
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.
-
How shall I get a QTreeWidgetItem LeftTop position (in pixel) after I get this item with the itemAt?
treeWidget()->itemWidget(poTreeItem,0)->rect().topLeft();