How to find the Pos of a QTreeWidgetItem

Hi,

How do we find the position i.e. x & y for a QTreewidgetitem inside a QTreeWIdget.
I am using a context menu on the WidgetItem and need to show a text box besides the node.

Thanks
Ganesh

Hi,

maybe it is sufficient for you to set a tool tip Qt 4.5: QTreeWidgetItem Class Reference to get what you want. Otherwise you have to intercept the mouse event in Qt 4.5: QAbstractItemView Class Reference by reimplementing the virtual function, doing your stuff with the event Qt 4.5: QMouseEvent Class Reference where you get the x and y position and then calling the base function.

Hope this helps

Just forgot to mention how to get the item belonging to the mouse position. For this you have to use Qt 4.5: QTreeWidget Class Reference with the position which will give you the item for that position.

Hope this helps