当前位置: 首页>>代码示例>>Python>>正文


Python QObject.__init__方法代码示例

本文整理汇总了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()
开发者ID:Tayyib,项目名称:uludag,代码行数:10,代码来源:Commander.py

示例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()
开发者ID:Tayyib,项目名称:uludag,代码行数:13,代码来源:Notifier.py

示例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)
开发者ID:Tayyib,项目名称:uludag,代码行数:13,代码来源:Commander.py

示例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)
开发者ID:Tayyib,项目名称:uludag,代码行数:14,代码来源:Commander.py

示例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)
开发者ID:KDE,项目名称:kajongg,代码行数:14,代码来源:qt4reactor.py

示例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()
开发者ID:patrickkidd,项目名称:pksampler-0.3,代码行数:54,代码来源:SampleControl.py

示例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
开发者ID:dobbs,项目名称:dobbse.net,代码行数:17,代码来源:demo.py

示例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
开发者ID:DLR-SC,项目名称:DataFinder,代码行数:20,代码来源:data_type_dialog.py

示例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)
开发者ID:KDE,项目名称:kajongg,代码行数:20,代码来源:statesaver.py

示例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
开发者ID:DLR-SC,项目名称:DataFinder,代码行数:20,代码来源:relation_type_dialog.py

示例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()
开发者ID:blackPantherOS,项目名称:packagemanagement,代码行数:42,代码来源:ksmarttray.py

示例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)
开发者ID:boudewijnrempt,项目名称:kura,代码行数:26,代码来源:comboproxy.py

示例13: __init__

# 需要导入模块: from qt import QObject [as 别名]
# 或者: from qt.QObject import __init__ [as 别名]
 def __init__(self):
     PureTree.__init__(self)
     QObject.__init__(self)
开发者ID:Sandy4321,项目名称:nltk_contrib,代码行数:5,代码来源:tree_qt.py

示例14: __init__

# 需要导入模块: from qt import QObject [as 别名]
# 或者: from qt.QObject import __init__ [as 别名]
    def __init__(self):
        """ Constructor. """

        QObject.__init__(self)
        self.__mainThreadIdentifier = get_ident()
开发者ID:DLR-SC,项目名称:DataFinder,代码行数:7,代码来源:utils.py


注:本文中的qt.QObject.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。