openSUSE Forums > Programming/Scripting » How to find the Pos of a QTreeWidgetItem

Go Back   openSUSE Forums > Programming/Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-Sep-2009, 23:50
ganeshbiyer's Avatar
Puzzled Penguin
 
Join Date: Sep 2009
Location: Bangalore, India
Posts: 3
ganeshbiyer hasn't been rated much yet
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
Reply With Quote
  #2 (permalink)  
Old 05-Sep-2009, 11:12
Monex's Avatar
Busy Penguin
 
Join Date: Jun 2008
Location: Germany
Posts: 256
Monex hasn't been rated much yet
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
Reply With Quote
  #3 (permalink)  
Old 05-Sep-2009, 12:07
Monex's Avatar
Busy Penguin
 
Join Date: Jun 2008
Location: Germany
Posts: 256
Monex hasn't been rated much yet
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
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2