本文整理汇总了Python中Command.Command.start方法的典型用法代码示例。如果您正苦于以下问题:Python Command.start方法的具体用法?Python Command.start怎么用?Python Command.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command.Command
的用法示例。
在下文中一共展示了Command.start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Tray
# 需要导入模块: from Command import Command [as 别名]
# 或者: from Command.Command import start [as 别名]
class Tray(QtGui.QSystemTrayIcon):
def __init__(self, parent=None):
QtGui.QSystemTrayIcon.__init__(self, parent)
self.window = parent
self.setIcon(QtGui.QIcon("resources/img/icon.png"))
self.iconMenu = QtGui.QMenu(parent)
appactivate = self.iconMenu.addAction("Activate")
skyzoneMenu = QtGui.QMenu(self.iconMenu)
skyzoneMenu.setTitle("Skyzone")
self.iconMenu.addMenu(skyzoneMenu)
strikeMenu = QtGui.QMenu(self.iconMenu)
strikeMenu.setTitle("Strike")
self.iconMenu.addMenu(strikeMenu)
skyzonedevup = skyzoneMenu.addAction("Up Dev")
skyzoneupprod = skyzoneMenu.addAction("Up Prod")
strikedevup = strikeMenu.addAction("Up Dev")
strikeupprod = strikeMenu.addAction("Up Prod")
self.setContextMenu(self.iconMenu)
self.connect(appactivate,QtCore.SIGNAL('triggered()'),self.appActivate)
self.connect(skyzonedevup,QtCore.SIGNAL('triggered()'),self.skyzonedevup)
self.connect(strikedevup,QtCore.SIGNAL('triggered()'),self.strikedevup)
quitAction = QtGui.QAction("&Quit", self, triggered=QtGui.qApp.quit)
self.iconMenu.addAction(quitAction)
self.show()
def skyzonedevup(self):
self.thread = Command('Up Skyzone Dev')
self.window.printMessage('Up Skyzone Dev')
QtCore.QObject.connect(self.thread, QtCore.SIGNAL("executeCommandFinished(PyQt_PyObject, PyQt_PyObject)"), self.executeCommandFinished)
self.thread.start()
def strikedevup(self):
#self.window.createCommand('Up Strike Dev')
self.window.printMessage('Up Strike Dev')
self.thread = Command('Up Strike Dev')
QtCore.QObject.connect(self.thread, QtCore.SIGNAL("executeCommandFinished(PyQt_PyObject, PyQt_PyObject)"), self.executeCommandFinished)
self.thread.start()
def executeCommandFinished(self, command, result):
TooltipManage.create('Command', command, result)
def appActivate(self):
self.window.activate() # reffer Milana.py activate