Results 1 to 3 of 3

Thread: How to find the Pos of a QTreeWidgetItem

  1. #1
    ganeshbiyer NNTP User

    Default 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

  2. #2
    Join Date
    Jun 2008
    Location
    Germany
    Posts
    301

    Default Re: How to find the Pos of a QTreeWidgetItem

    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

  3. #3
    Join Date
    Jun 2008
    Location
    Germany
    Posts
    301

    Default Re: How to find the Pos of a QTreeWidgetItem

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •