PDA

View Full Version : QTreeWidget right click?



jbpvr
20th February 2007, 20:23
QT 4.2

I need to be able to right click in a QTreeWidget and display a context menu depending on where you are in the tree.

I read that you can specify the Widget to signal a contextmenu event, which will give you a position that you can map back to a QWidget, but it doesn't look like the QTreeWidgetItem inherits from QWidget (according to the documentation and looking at the header)

Can I get a context menu at an QTreeWidgetItem?

Or am I going to have to do some round about what to do this?

Thanks

jpn
20th February 2007, 20:30
QTreeWidgetItem is not a QWidget but QTreeWidget is. Check for example this post: http://www.qtcentre.org/forum/f-newbie-4/t-different-pop-up-menus-wanted-1710.html#4

jbpvr
20th February 2007, 21:03
ahh, good stuff. Thanks