On Friday, May 31, 2013 4:39:41 AM UTC-7, Carlos Rico wrote:
> Hi. I know I can mix Qt widgets and Maya UI controls and that Qt widgets can 
> have context menus but, I like Maya's Radial Marking menu feature a lot and 
> all of a sudden I wonder, does PyQt have something similar to a Maya
>  Radial/Pie Marking Menu? I've been searching for information about it but 
> found none. 
> 
> If not, is it possible to attach a Maya 
> Marking Menu to a QPushButton or any Qt widget for that matter? or can I 
> recreate this behaviour with PyQt? Thanks in advance.
> 
> 
> Carlos Rico Adega
> 
> 
> -------------------------------------
>  LinkedIn
> [email protected]

I have done the latter:

# Context Menu          
someWidget.setContextMenuPolicy(PyQt4.QtCore.Qt.CustomContextMenu)
self.connect(someWidget, PyQt4.QtCore.SIGNAL('customContextMenuRequested(const 
QPoint&)'), contextMenuExec)
myContextMenu = PyQt4.QtGui.QMenu(self)

# Context menu method
def contextMenuExec(point):
    # show context menu
    action = myContextMenu.exec_(someWidget.mapToGlobal(point))
    if action:
        methodToExecuteWhenMenuItemIsSelected(action.text(), otherArgs)

Hope that helps

-- 
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 [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to