471,356 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

Contextmenu in a QTreeWidget with PyQT

I apologize in advance if this is not the correct forum to ask this
and if someone knows a better place, please let me know. But, I am
trying to create a Contextmenu (a right-click popup menu) from within
a QTreeWidget. I tried setting the contextMenuPolicy to
CustomContextMenu and then handling the signal
customContextMenuRequested() but nothing seems to be happening. ie:
self.tree = QTreeWidget()
self.tree.setContextMenuPolicy(Qt.CustomContextMen u)

self.connect(self.tree,SIGNAL('customContextMenuRe quested()'),self.newContext)

Does anyone have a sample or tutorial on how to do this? One other
question, whe I right click, it changes the selection in the
TreeWidget, would I need to remove the handler for right clicks to get
the menu? Thanks!!

B
Nov 21 '07 #1
0 1532

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Ilya Knizhnik | last post: by
35 posts views Thread by Vamsi Mudrageda | last post: by
8 posts views Thread by simo | last post: by
10 posts views Thread by svenn.are | last post: by
3 posts views Thread by Fabio | last post: by
10 posts views Thread by Simon John | last post: by
4 posts views Thread by Phil Thompson | last post: by
11 posts views Thread by Graham Charles | last post: by
3 posts views Thread by Phil Thompson | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.