本文整理汇总了Python中PyQt4.QtGui.QMenu.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QMenu.__init__方法的具体用法?Python QMenu.__init__怎么用?Python QMenu.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QMenu
的用法示例。
在下文中一共展示了QMenu.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, parent, plot):
QMenu.__init__(self, plot.name(), parent)
color_menu = CurveColorMenu(self,plot)
marker_menu = CurveMarkerMenu(self,plot)
self.addMenu(color_menu)
self.addMenu(marker_menu)
self.addAction('&Remove', lambda: parent.track.remove_plot(plot))
示例2: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, main_window):
self.main_window = main_window
QMenu.__init__(self, '&Tracks', main_window)
self.addAction('&Add', self.add_track)
self.addAction('&Remove', self.remove_track)
self.addAction('&Merge', self.merge_tracks)
self.addAction('&Set Index', self.set_index)
示例3: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, parent=None):
QMenu.__init__(self)
self.parent = parent
self.stations_menu = self.addMenu("Stations")
self.add_stations()
self.addSeparator()
self.action_pause = QAction(
QIcon(":icons/media-playback-pause.png"), "Pause", self)
self.action_pause.triggered.connect(self.parent.radio.action_pause.emit)
self.action_pause.setEnabled(False)
self.addAction(self.action_pause)
self.action_stop = QAction(
QIcon(":icons/media-playback-stop.png"), "Stop", self)
self.action_stop.triggered.connect(self.parent.radio.action_stop.emit)
self.action_stop.setEnabled(False)
self.addAction(self.action_stop)
self.addSeparator()
action = QAction(
QIcon(":icons/application-exit.png"), "&Close", self)
action.triggered.connect(QApplication.quit)
self.addAction(action)
示例4: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, parent, mainWindow, tags, selectItem = None):
QMenu.__init__(self, tags, parent)
self.tags = tags
self.__mainWindow = mainWindow
self.callbackSelected = selectItem
self.loader = loader.loader()
self.Load()
示例5: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, titre='', liste=None, fonction=None, aide=''):
QMenu.__init__(self, titre)
# self.parent = parent
self.fonction = None
# self.titre = titre
# self.setTitle(titre)
self.update(liste, fonction, aide)
示例6: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, canvas):
QMenu.__init__(self)
self.canvas = canvas
select = canvas.select
self.setTitle(canvas.select.nom_complet)
for obj in canvas.selections:
if obj is not select:
# Permet de sélectionner les autres objets à proximité
action = self.addAction(u"Sélectionner " + obj.nom_complet)
action.triggered.connect(partial(self.select, obj))
if len(canvas.selections) > 1:
self.addSeparator()
action = self.addAction(u"Supprimer")
commande = u"%s.supprimer()" % select.nom
action.triggered.connect(partial(self.executer, commande))
visible = select.style("visible")
action = self.addAction(u"Masquer" if visible else u"Afficher")
commande = u"%s.style(visible = %s)" % (select.nom, not visible)
action.triggered.connect(partial(self.executer, commande))
action = self.addAction(u"Renommer")
action.triggered.connect(self.renommer)
msg = u"Éditer le texte" if isinstance(select, Texte_generique) else u"Texte associé"
action = self.addAction(msg)
action.triggered.connect(self.etiquette)
action = self.addAction((u"Masquer" if select.label() else u"Afficher") + u" nom/texte")
action.triggered.connect(self.masquer_nom)
self.addSeparator()
action = self.addAction(u"Redéfinir")
action.triggered.connect(self.redefinir)
self.addSeparator()
if isinstance(canvas.select, Point_generique):
relier = self.addMenu(u"Relier le point")
action = relier.addAction(u"aux axes")
commande = u"%s.relier_axes()" %select.nom
action.triggered.connect(partial(self.executer, commande))
action = relier.addAction(u"à l'axe des abscisses")
commande = u"%s.relier_axe_x()" %select.nom
action.triggered.connect(partial(self.executer, commande))
action = relier.addAction(u"à l'axe des ordonnées")
commande = u"%s.relier_axe_y()" %select.nom
action.triggered.connect(partial(self.executer, commande))
self.addSeparator()
action = self.addAction(u"Propriétés")
action.triggered.connect(self.proprietes)
示例7: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, parent, mainWindow, node = None, selectItem = None):
QMenu.__init__(self, mainWindow)
self.loader = loader.loader()
self.callbackSelected = self.selectNode
self.parent = parent
self.mainWindow = mainWindow
self.node = node
self.Load()
actions = []
示例8: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, locator):
QMenu.__init__(self, 'Plugin Tools')
self._locator = locator
self.explorer_s = self._locator.get_service('explorer')
self._proc = QProcess(self)
action_zip = self.addAction('Package This Plugin!')
self.connect(action_zip, SIGNAL("triggered()"), self.create_zip)
action_run = self.addAction('Test This Plugin on NINJA-IDE!')
self.connect(action_run, SIGNAL("triggered()"), self.run_plugin)
示例9: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, title, flag, parent, group):
"""
Constructor
"""
QMenu.__init__(self, parent)
self.parent = parent
self.setTitle(title)
self.flag = flag
self.group = group
self.addMyActions()
示例10: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, locator):
QMenu.__init__(self, 'Al\'exa Project: IDE Properties')
self.ocrdatafolder = ""
self.logFolder = ""
self._locator = locator
self.explorer_s = self._locator.get_service('explorer')
self._proc = QProcess(self)
action_change_ocr_data_folder = self.addAction('Select Ocr Data Folder')
self.connect(action_change_ocr_data_folder, SIGNAL("triggered()"), self.change_ocr_data_folder)
action_change_log_folder = self.addAction('Select Log Folder')
self.connect(action_change_log_folder, SIGNAL("triggered()"), self.change_log_folder)
示例11: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, parent, main, model=None):
QMenu.__init__(self, main)
self.model = model
self.browser = parent
self.parent = parent
self.tagsmanager = TagsManager.get()
self.setTitle(QString("Tags"))
self.connect(self, SIGNAL("aboutToShow"), self.refreshTagMenu)
self.manageAction = QAction(QString(self.tr("Manage tags")), self)
self.connect(self.manageAction, SIGNAL("triggered(bool)"), self.openDialog)
self.connect(self, SIGNAL("triggered(QAction*)"), self.tagNodes)
self.refreshTagMenu()
示例12: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.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 )
示例13: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, net, parent):
QMenu.__init__(self, parent)
def editIntermediate(value):
self.emit(SIGNAL('edit'), net)
def deleteIntermediate(value):
self.emit(SIGNAL('delete'), net)
edit_net = QAction(QIcon(":icons/edit"), self.tr("Edit network parameters"), parent)
self.connect(edit_net, SIGNAL('triggered(bool)'), editIntermediate )
del_net = QAction(QIcon(":icons/delete"), self.tr("Delete this network"), parent)
self.connect(del_net, SIGNAL('triggered(bool)'), deleteIntermediate)
self.setObjectName("menu_%s" % net.label)
actions = edit_net, del_net
for action in actions:
self.addAction(action)
示例14: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, getShare, getMultipleShare, download, tabs_results, tab_downloads, tabs, parent, blacklist=None):
QMenu.__init__(self, parent)
# Vars
self.blacklist = blacklist
self.getShare = getShare
self.getMultipleShare = getMultipleShare
self.download = download
self.tabs_results = tabs_results
self.tab_downloads = tab_downloads
self.tabs = tabs
self.parent = parent
# Actions
downloadAction = self.addAction(u"Télécharger")
downloadToAction = self.addAction(u"Télécharger vers...")
copyAction = self.addAction("Copier l'URL")
openAction = self.addAction("Ouvrir")
exploreAction = self.addAction("Parcourir le dossier")
displaySharesAction = self.addAction("Afficher les partages de l'utilisateur")
noShareAction = self.addAction("Masquer les partages de l'utilisateur")
searchSameAction = self.addAction("Rechercher des fichiers similaires")
# Desactivation d'actions impossibles
as_a_folder = False
for share in self.getMultipleShare():
if type(share) is not FileShare:
as_a_folder = True
if as_a_folder:
downloadAction.setEnabled(False)
downloadToAction.setEnabled(False)
if isinstance(self.parent, BrowserFtp.BrowserFtp):
noShareAction.setEnabled(False)
#########################################################
# On désactive les boutons qui sont pas encore implantés
noShareAction.setEnabled(False)
#########################################################
# Signaux
self.connect(downloadAction, SIGNAL('triggered()'), self.download_Action)
self.connect(downloadToAction, SIGNAL('triggered()'), self.download_to_Action)
self.connect(copyAction, SIGNAL('triggered()'), self.copy_Action)
self.connect(openAction, SIGNAL('triggered()'), self.open_Action)
self.connect(exploreAction, SIGNAL('triggered()'), self.open_Action)
self.connect(displaySharesAction, SIGNAL('triggered()'), self.display_shares_Action)
self.connect(noShareAction, SIGNAL('triggered()'), self.no_share_Action)
self.connect(searchSameAction, SIGNAL('triggered()'), self.search_same_Action)
示例15: __init__
# 需要导入模块: from PyQt4.QtGui import QMenu [as 别名]
# 或者: from PyQt4.QtGui.QMenu import __init__ [as 别名]
def __init__(self, parent=None):
QMenu.__init__(self)
self.parent = parent
action = QAction("&Check mail", self)
action.triggered.connect(self.parent.check)
self.addAction(action)
action = QAction("Compose mail", self)
action.triggered.connect(self.parent.compose)
self.addAction(action)
self.addSeparator()
action = QAction("&Preferences", self)
action.triggered.connect(self.parent.preferences)
self.addAction(action)
self.addSeparator()
action = QAction("&Close", self)
action.triggered.connect(QApplication.quit)
self.addAction(action)