本文整理匯總了Python中qt.QObject.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python QObject.__init__方法的具體用法?Python QObject.__init__怎麽用?Python QObject.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qt.QObject
的用法示例。
在下文中一共展示了QObject.__init__方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self, parent):
QObject.__init__(self)
self.parent = parent
try:
self.comar = ComarIface.ComarIface(self.handler, self.errHandler)
except:
self.parent.showErrorMessage(i18n("Cannot connect to Comar daemon"))
self.parent.updateGui()
示例2: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self):
QObject.__init__(self)
bus = dbus.SessionBus()
self.notifyid = 0
try:
object = bus.get_object("org.freedesktop.Notifications", "/org/freedesktop/Notifications")
self.iface = dbus.Interface(object, dbus_interface='org.freedesktop.Notifications')
object.connect_to_signal("ActionInvoked", self.click_handler, dbus_interface="org.freedesktop.Notifications")
except dbus.DBusException:
traceback.print_exc()
示例3: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self, parent):
QObject.__init__(self)
self.parent = parent
# Modal dialogs freezes pm in dbus signal path
self.delayTimer = QTimer(self)
self.lastError = None
##
self.connect(self.delayTimer, SIGNAL("timeout()"), self.exceptionHandler)
self.iface = PisiIface.Iface()
self.iface.setHandler(self.handler)
self.iface.setExceptionHandler(self.exceptionHandler)
示例4: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self, parent):
QObject.__init__(self)
try:
self.comar = ComarIface.ComarIface(self)
except:
parent.showErrorMessage("Cannot connect to Comar daemon")
self.parent = parent
# Init the database
pisi.api.init(database=True, write=False)
示例5: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self, parent, reactor, watcher, socketType):
QObject.__init__(self, parent)
self.reactor = reactor
self.watcher = watcher
fd = watcher.fileno()
self.notifier = QSocketNotifier(fd, socketType, parent)
self.notifier.setEnabled(True)
if socketType == QSocketNotifier.Read:
self.fn = self.read
else:
self.fn = self.write
self.notifier.activated.connect(self.fn)
示例6: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self):
""" sample -> splitter |-> volume -> pan -> muter -> mixers[0]
|-> volume -> pan -> muter -> mixers[1]
| ...
|-> volume -> pan -> mute from globals import *
"""
QObject.__init__(self)
self.sample = None
self.currentCue = 0
self.cues = []
self.groupingEnabled = 0
self.beatSynced = 0
self.pitchRange = PITCH_RANGE
self.savedPitchRange = 0
self.driver = pkaudio.Driver()
# Pitch : when real/temp pitch match, pitch is not bent
self.pitchTimer = QTimer(self)
QObject.connect(self.pitchTimer, SIGNAL("timeout()"),
self.slotDoPitchBend)
self.pitchTemp = 0.0 # the bent pitch
self.realPitch = 0.0 # the original pitch
self.pitchDirection = "back"
self.path = None
self.splitter = pkaudio.Splitter()
# Effect chains
effectChain0 = {}
effectChain1 = {}
self.effectChains = [effectChain0, effectChain1]
# connect eveything up
for i, chain in enumerate(self.effectChains):
chain['volume'] = pkaudio.Volume()
chain['pan'] = pkaudio.Pan()
chain['peak'] = pkaudio.PeakModule()
chain['muter'] = pkaudio.Muter()
chain['muter'].setOn(0)
chain['volume'].outputPort().connect(chain['pan'].inputPort())
chain['pan'].outputPort().connect(chain['peak'].inputPort())
chain['peak'].outputPort().connect(chain['muter'].inputPort())
if i != 1:
self.splitter.outputPort(i).connect(chain['volume'].inputPort())
else:
self.splitter.outputPort(i).connect(chain['pan'].inputPort())
self.effectChains[0]['volume'].setProperty('volume', 75)
self.slotConnectMixers()
示例7: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self, iter):
QObject.__init__(self)
limits = []
d = _all(_ithird_column(_isave_limits(_isplit(_inon_empty_lines(iter)), limits)))
droot = int(sqrt(len(d)))
if len(d) != droot * droot:
raise AttributeError("data must be square")
self.xmin, self.xmax = 0, droot
self.ymin, self.ymax = 0, droot
self.zmin, self.zmax = limits[2].min, limits[2].max
self.data = reshape(array(d), (droot, droot))
self.x = 0
self.y = 0
self.s = 30
self.r = 1
示例8: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self, title, dataModelHandler, propertyDefinitionFactory, iconHandler):
"""
Constructor.
@param title: Name of edited data type if existing, "New_DataType" otherwise (at the same time a title from this dialog).
@type title: C{unicode}
"""
QObject.__init__(self)
self._dataModelHandler = dataModelHandler
self._propertyDefinitionFactory = propertyDefinitionFactory
self._iconHandler = iconHandler
self.__dataType = self._dataModelHandler.createDataType(title)
self.__title = title
self.__referenceTitle = title
self.__iconName = None
self.__propertyList = None
示例9: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self, *what):
QObject.__init__(self)
pref = Internal.Preferences
if what[0] not in StateSaver.savers:
StateSaver.savers[what[0]] = self
what[0].installEventFilter(self)
self.widgets = []
for widget in what:
name = self.__generateName(widget)
self.widgets.append((name, widget))
pref.addString('States', name + 'State')
pref.addString('States', name + 'Geometry')
for name, widget in self.widgets:
stateFound = self.__restore(widget, name + 'State')
geometryFound = self.__restore(widget, name + 'Geometry')
if not stateFound and not geometryFound:
pref.addString('States', name)
self.__restore(widget, name)
示例10: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self, title, dataModelHandler, iconHandler):
"""
Constructor.
@param title: Name of edited relation type if existing, "New_RelationType" otherwise (at the same time a title from this dialog).
@type title: C{unicode}
"""
QObject.__init__(self)
self._dataModelHandler = dataModelHandler
self._iconHandler = iconHandler
self.__relationType = self._dataModelHandler.createRelation(title)
self.__title = title
self.__referenceTitle = title
self.__iconName = None
self.__parentDataTypeList = None
self.__childDataTypeList = None
self.__availableDataTypeList = self._dataModelHandler.datatypes
示例11: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self):
QObject.__init__(self)
self.sysTray = KMySystemTray()
self.sysTray.setPixmap(self.sysTray.loadIcon("ksmarttray"))
self.sysTray.show()
self.process = KProcIO()
self.state = KSmartTray.State.Waiting
self.lastKnownStatus = ""
self.blinkFlag = False
self.updateFailed = False
self.checkTimer = QTimer()
self.blinkTimer = QTimer()
QObject.connect(self.checkTimer, SIGNAL("timeout()"), self.checkUpgrades)
QObject.connect(self.process, SIGNAL("processExited(KProcess *)"),
self.processDone)
QObject.connect(self, PYSIGNAL("foundNewUpgrades()"), self.startBlinking)
QObject.connect(self, PYSIGNAL("foundNoUpgrades()"), self.stopBlinking)
QObject.connect(self.sysTray, PYSIGNAL("mouseEntered()"), self.stopBlinking)
QObject.connect(self.blinkTimer, SIGNAL("timeout()"), self.toggleBlink)
QObject.connect(self.sysTray.checkAction, SIGNAL("activated()"),
self.manualCheckUpgrades)
QObject.connect(self.sysTray.startSmartAction, SIGNAL("activated()"),
self.startSmart)
QObject.connect(self.sysTray.stopAction, SIGNAL("activated()"),
self.stopChecking)
QObject.connect(self.sysTray, SIGNAL("quitSelected()"),
KApplication.kApplication(), SLOT("quit()"))
QObject.connect(self.sysTray, PYSIGNAL("activated()"), self.runUpgrades)
self.checkTimer.start(5*60*1000)
self.checkUpgrades()
示例12: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self, comboBox, table, currentKey=None, nullAllowed=False):
QObject.__init__(self)
self.comboBox=comboBox
self.key_to_index={}
self.index_to_key={}
if nullAllowed:
self.comboBox.insertItem("<None>")
self.key_to_index[None]=self.comboBox.count()-1
self.index_to_key[self.comboBox.count()-1]=None
for row in table:
self.comboBox.insertItem(row.getDescription())
primaryKey = row.getPrimaryKey()
self.key_to_index[primaryKey] = self.comboBox.count()-1
self.index_to_key[self.comboBox.count()-1] = primaryKey
if currentKey!=None:
self.setCurrentItem(currentKey)
self.connect(self.comboBox, SIGNAL("activated (int)"),
self.slotItemSelected)
self.comboBox.setAutoCompletion(True)
示例13: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self):
PureTree.__init__(self)
QObject.__init__(self)
示例14: __init__
# 需要導入模塊: from qt import QObject [as 別名]
# 或者: from qt.QObject import __init__ [as 別名]
def __init__(self):
""" Constructor. """
QObject.__init__(self)
self.__mainThreadIdentifier = get_ident()