本文整理汇总了Python中PySide.QtGui.QMenu.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QMenu.__init__方法的具体用法?Python QMenu.__init__怎么用?Python QMenu.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QMenu
的用法示例。
在下文中一共展示了QMenu.__init__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide.QtGui import QMenu [as 别名]
# 或者: from PySide.QtGui.QMenu import __init__ [as 别名]
def __init__(self, parent=None):
QMenu.__init__(self, "&Signals")
self.parent = parent
self.addSignalAction = self.addAction(self.trUtf8("&Add Signal"))
self.addSignalAction.triggered.connect(self.addSignal)
self.addSignalAction.setEnabled(False)
self.applyOperationAction = self.addAction(self.trUtf8("&Apply Operation"))
self.applyOperationAction.triggered.connect(self.applyOperation)
self.applyOperationAction.setEnabled(False)
示例2: __init__
# 需要导入模块: from PySide.QtGui import QMenu [as 别名]
# 或者: from PySide.QtGui.QMenu import __init__ [as 别名]
def __init__(self):
QMenu.__init__(self, "Set Status", None)
global gStatusTags
# ant: Could use hiero.core.defaultFrameRates() here but messes up with string matching because we seem to mix decimal points
self.statuses = gStatusTags
self._statusActions = self.createStatusMenuActions()
# Add the Actions to the Menu.
for act in self.menuActions:
self.addAction(act)
hiero.core.events.registerInterest("kShowContextMenu/kTimeline", self.eventHandler)
hiero.core.events.registerInterest("kShowContextMenu/kSpreadsheet", self.eventHandler)
示例3: __init__
# 需要导入模块: from PySide.QtGui import QMenu [as 别名]
# 或者: from PySide.QtGui.QMenu import __init__ [as 别名]
def __init__( self, parent ):
QMenu.__init__( self, parent )
# add actions and a separator
hello = self.addAction("Print 'Hello!'")
self.addSeparator()
world = self.addAction("Print 'World!'")
# connect to the individual action's signal
hello.triggered.connect( self.hello )
world.triggered.connect( self.world )
# connect to the menu level signal
self.triggered.connect( self.menuTrigger )
示例4: __init__
# 需要导入模块: from PySide.QtGui import QMenu [as 别名]
# 或者: from PySide.QtGui.QMenu import __init__ [as 别名]
def __init__ ( self, manager, parent, controller ):
""" Creates a new tree.
"""
# Base class constructor:
QMenu.__init__( self, parent )
# The parent of the menu:
self._parent = parent
# The manager that the menu is a view of:
self._manager = manager
# The controller:
self._controller = controller
# Create the menu structure:
self.refresh()
# Listen to the manager being updated:
self._manager.on_facet_set( self.refresh, 'changed' )
self._manager.on_facet_set( self._on_enabled_modified, 'enabled' )