By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,235 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,235 IT Pros & Developers. It's quick & easy.

Contextmenu in a QTreeWidget with PyQT

P: n/a
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!!

Nov 21 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.