right click menu in treeView

139 views
Skip to first unread message

Todd Widup

unread,
May 10, 2017, 2:12:20 AM5/10/17
to python_in...@googlegroups.com
I am trying to get a right click context menu working in a UI

        self.treeView = QTreeView()
        self.treeView.setContextMenuPolicy(Qt.CustomContextMenu)
        self.treeView.customContextMenuRequested.connect(self.openMenu)

self.openMenu is a small  menu that should open when right clicked on a tree item, but nothing is executed.

any suggestions where to start looking


--
Todd Widup
Creature TD / Technical Artist
todd....@gmail.com

David Moulder

unread,
May 10, 2017, 5:02:54 AM5/10/17
to python_inside_maya
Hi Todd,

Is self.openMenu being triggered?  Have you added debug prints to confirm?  The above looks correct so I guessing it's something in the connected slot method, often the menu may be off screen or the actions not added correctly.

-Dave   

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CABBPk35Qzm9%2Bhs3TKHiQkWXUCN45N2rgz%3DM5ApYT-KwytsDNYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--

Todd Widup

unread,
May 10, 2017, 10:59:55 AM5/10/17
to python_in...@googlegroups.com
so thats it actually  its not as I put a few prints in to see.  

ok will dive into that part a bit more  thanks

On Wed, May 10, 2017 at 2:02 AM, David Moulder <da...@thirstydevil.co.uk> wrote:
Hi Todd,

Is self.openMenu being triggered?  Have you added debug prints to confirm?  The above looks correct so I guessing it's something in the connected slot method, often the menu may be off screen or the actions not added correctly.

-Dave   
On Wed, May 10, 2017 at 7:12 AM, Todd Widup <todd....@gmail.com> wrote:
I am trying to get a right click context menu working in a UI

        self.treeView = QTreeView()
        self.treeView.setContextMenuPolicy(Qt.CustomContextMenu)
        self.treeView.customContextMenuRequested.connect(self.openMenu)

self.openMenu is a small  menu that should open when right clicked on a tree item, but nothing is executed.

any suggestions where to start looking


--
Todd Widup
Creature TD / Technical Artist
todd....@gmail.com

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages