本文整理匯總了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