no idea how it would handle inside maya but, this should get
you started:
/code
from PySide import QtGui, QtCore
class XSITypeMenuThing(QtCore.QObject):
def eventFilter(self, obj, event):
mods = QtGui.QApplication.keyboardModifiers()
if mods == QtCore.Qt.ShiftModifier:
if event.type() in
[QtCore.QEvent.MouseButtonRelease] and isinstance(obj,
QtGui.QMenu):
if obj.activeAction() and not
obj.activeAction().menu():
obj.activeAction().trigger()
return True
return super(XSITypeMenuThing, self).eventFilter(obj,
event)
if __name__ == '__main__':
app = QtGui.QApplication([])
window = QtGui.QMainWindow()
menu = QtGui.QMenu("menu", window)
fil = XSITypeMenuThing()
menu.installEventFilter(fil)
menu.addAction(QtGui.QAction('You', menu, checkable=True))
menu.addAction(QtGui.QAction('Will', menu, checkable=True))
menu.addAction(QtGui.QAction('Need', menu, checkable=True))
menu.addAction(QtGui.QAction('To', menu, checkable=True))
menu.addAction(QtGui.QAction('Send', menu, checkable=True))
menu.addAction(QtGui.QAction('Me', menu, checkable=True))
menu.addAction(QtGui.QAction('Money', menu,
checkable=True))
window.menuBar().addMenu(menu)
window.show()
app.exec_()
--
Jon Swindells
[email protected]
On Wed, Jul 9, 2014, at 07:10 PM, Tim Crowson wrote:
I'm asking this here because XSI users will immediately know
the behavior I'm trying to emulate. I want to recreate Soft's
menu behavior whereby shift-clicking on a menu item will
check/uncheck it, but keep the menu open and let you click on
other entries as well. Is this behavior reproducible in
PySide/PyQt, if so how? I'm searching around now, but wanted to
drop a line here too.
-- Tim Crowson