當前位置: 首頁>>代碼示例>>Python>>正文


Python QtCore.QEvent類代碼示例

本文整理匯總了Python中PyQt4.QtCore.QEvent的典型用法代碼示例。如果您正苦於以下問題:Python QEvent類的具體用法?Python QEvent怎麽用?Python QEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了QEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

 def __init__(self, etype, key, value=None, oldValue=None):
     """
     Initialize the event instance
     """
     QEvent.__init__(self, etype)
     self.__key = key
     self.__value = value
     self.__oldValue = oldValue
開發者ID:AutumnLight,項目名稱:orange,代碼行數:8,代碼來源:settings.py

示例2: __init__

 def __init__(self, function, args, kwargs):
     QEvent.__init__(self, QueuedCallEvent.QueuedCall)
     self.function = function
     self.args = args
     self.kwargs = kwargs
     self._result = None
     self._exc_info = None
     self._state = 0
開發者ID:pauloortins,項目名稱:Computer-Vision-Classes---UFBA,代碼行數:8,代碼來源:outputview.py

示例3: write

    def write(self, str):
        """ Emulate write function """

        if self.guistream.thread() != QThread.currentThread():
            sys_stdout.write(str)
            e = QEvent(QEvent.Type(RedirectionEventId))
            e.txt = str
            QApplication.postEvent(self.guistream,e)
            pass
        else:
            self.guistream.write(str)
開發者ID:LeeKamentsky,項目名稱:ilastik-0.5,代碼行數:11,代碼來源:shellWidget.py

示例4: set

 def set(self, rms, peak, decay):
     """ This is the main function, call this from any thread.
     0.0 <= rms, peak, decay <= 1.0
     """
     t = time.time() * 0.1
     if t - self._last_time > self.gov_sec:
         self._last_time = t
         e = QEvent(QEvent.User)
         e.rms = rms
         e.peak = peak
         e.decay = decay
         QCoreApplication.instance().postEvent(self, e)
開發者ID:patrickkidd,項目名稱:pksampler,代碼行數:12,代碼來源:audiostub.py

示例5: timerEvent

 def timerEvent(self, e):
     if self.percent == 100:
         self.killTimer(self.tid)
    
     event = QEvent(QEvent.User)
     data = {}
     data['tracknum'] = 0
     data['state'] = 'enc'
     data['percent'] = self.percent
     data['track'] = 'Banco de Patricio'
     data['genre'] = 'Christmas'
     data['album'] = 'Patricio Nino'
     data['artist'] = 'AAAorthman'
     event.data = data
     self.emit(SIGNAL('status(QEvent *)'), event)
     self.percent += 10
開發者ID:RikVerschueren,項目名稱:AccordionMega,代碼行數:16,代碼來源:ripperwidget.py

示例6: __init__

 def __init__(self):
     QEvent.__init__(self, QEvent.User)
開發者ID:PierreBdR,項目名稱:point_tracker,代碼行數:2,代碼來源:algo.py

示例7: __init__

 def __init__(self, _, event):
     QEvent.__init__(self, _)
     self.event = event
開發者ID:Tayyib,項目名稱:uludag,代碼行數:3,代碼來源:ScrRescuePisi.py

示例8: __init__

 def __init__(self, state):
     QEvent.__init__(self, StateChangedEvent.StateChanged)
     self._state = state
開發者ID:CHANAYA,項目名稱:orange3,代碼行數:3,代碼來源:concurrent.py

示例9: __init__

 def __init__(self, nb):
     QEvent.__init__(self, self.event_type)
     self.nb = nb
開發者ID:PierreBdR,項目名稱:point_tracker,代碼行數:3,代碼來源:plottingdlg.py

示例10: __init__

 def __init__(self, func, *args, **kwargs):
     QEvent.__init__(self, QEvent.User)
     self.func = func
     self.args = args
     self.kwargs = kwargs
開發者ID:DanielSoell,項目名稱:picard,代碼行數:5,代碼來源:thread.py

示例11: ripper_event

 def ripper_event(self, e):
     """ """
     event = QEvent(event_type(e.type))
     event.data = e.__dict__
     QApplication.instance().postEvent(self, event)
開發者ID:RikVerschueren,項目名稱:AccordionMega,代碼行數:5,代碼來源:ripperwidget.py

示例12: __init__

 def __init__(self, etype):
     QEvent.__init__(self, etype)
開發者ID:astaric,項目名稱:orange-canvas,代碼行數:2,代碼來源:events.py

示例13: __init__

 def __init__(self, initstate):
     QEvent.__init__(self, WidgetManager.WidgetInitEvent.DelayedInit)
     self._initstate = initstate
開發者ID:astaric,項目名稱:orange-canvas,代碼行數:3,代碼來源:widgetsscheme.py

示例14: __init__

    def __init__(self, navdb):
        super(Gui, self).__init__([])
        self.acdata          = ACDataEvent()
        self.navdb           = navdb
        self.radarwidget     = []
        self.command_history = []
        self.cmdargs         = []
        self.history_pos     = 0
        self.command_mem     = ''
        self.command_line    = ''
        self.prev_cmdline    = ''
        self.simevent_target = 0
        self.mousepos        = (0, 0)
        self.prevmousepos    = (0, 0)
        self.panzoomchanged  = False

        # Register our custom pan/zoom event
        for etype in [PanZoomEventType, ACDataEventType, SimInfoEventType,
                      StackTextEventType, ShowDialogEventType,
                      DisplayFlagEventType, RouteDataEventType,
                      DisplayShapeEventType]:
            reg_etype = QEvent.registerEventType(etype)
            if reg_etype != etype:
                print('Warning: Registered event type differs from requested type id (%d != %d)' % (reg_etype, etype))

        self.splash = Splash()
        self.splash.show()

        self.splash.showMessage('Constructing main window')
        self.processEvents()

        # Install error message handler
        handler = QErrorMessage.qtHandler()
        handler.setWindowFlags(Qt.WindowStaysOnTopHint)

        # Check and set OpenGL capabilities
        if not QGLFormat.hasOpenGL():
            raise RuntimeError('No OpenGL support detected for this system!')
        else:
            f = QGLFormat()
            f.setVersion(3, 3)
            f.setProfile(QGLFormat.CoreProfile)
            f.setDoubleBuffer(True)
            QGLFormat.setDefaultFormat(f)
            print('QGLWidget initialized for OpenGL version %d.%d' % (f.majorVersion(), f.minorVersion()))

        # Create the main window and related widgets
        self.radarwidget = RadarWidget(navdb)
        self.win = MainWindow(self, self.radarwidget)
        self.nd  = ND(shareWidget=self.radarwidget)

        # Enable HiDPI support (Qt5 only)
        if QT_VERSION == 5:
            self.setAttribute(Qt.AA_UseHighDpiPixmaps)

        timer = QTimer(self)
        timer.timeout.connect(self.radarwidget.updateGL)
        timer.timeout.connect(self.nd.updateGL)
        timer.start(50)

        # Load geo data
        if False:
            pb = QProgressDialog('Binary buffer file not found, or file out of date: Constructing vertex buffers from geo data.', 'Cancel', 0, 100)
            pb.setWindowFlags(Qt.WindowStaysOnTopHint)
            pb.show()
            for i in range(101):
                pb.setValue(i)
                self.processEvents()
                QThread.msleep(100)
            pb.close()
開發者ID:junzis,項目名稱:bluesky,代碼行數:70,代碼來源:gui.py

示例15: __init__

 def __init__(self, func, *args):
     QEvent.__init__(self, self.EventType)
     if len(args) > 0:
         self.thunk = partial(func, *args)
     else:
         self.thunk = func
開發者ID:LimpingTwerp,項目名稱:applet-workflows,代碼行數:6,代碼來源:thunkEvent.py


注:本文中的PyQt4.QtCore.QEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。