Arseniy
Arseniy

Reputation: 304

How to get QTreeWidgetItem position?

How shall I get a QTreeWidgetItem LeftTop position (in pixel) after I get this item with the itemAt?

Is there a simple way?

Upvotes: 2

Views: 1641

Answers (1)

G.M.
G.M.

Reputation: 12879

If you have a QTreeWidgetItem * pitem you can use QTreeWidget::visualitemRect...

QRect viewport_relative_rect = pitem->treeWidget()->visualItemRect(pitem);

Upvotes: 2

Related Questions