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


Python QtCore.QEvent方法代碼示例

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


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

示例1: event

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def event(self, e):
        if not isinstance(e, (
                QtCore.QEvent,
                QtCore.QChildEvent,
                QtCore.QDynamicPropertyChangeEvent,
                QtGui.QPaintEvent,
                QtGui.QHoverEvent,
                QtGui.QMoveEvent,
                QtGui.QEnterEvent,
                QtGui.QResizeEvent,
                QtGui.QShowEvent,
                QtGui.QPlatformSurfaceEvent,
                QtGui.QWindowStateChangeEvent,
                QtGui.QKeyEvent,
                QtGui.QWheelEvent,
                QtGui.QMouseEvent,
                QtGui.QFocusEvent,
                QtGui.QHelpEvent,
                QtGui.QHideEvent,
                QtGui.QCloseEvent,
                QtGui.QInputMethodQueryEvent,
                QtGui.QContextMenuEvent,
                )):
            log().warning("unknown event: %r %r", e.type(), e)
        return super().event(e) 
開發者ID:frans-fuerst,項目名稱:track,代碼行數:27,代碼來源:mainwindow.py

示例2: log_events

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def log_events(klass: typing.Type) -> typing.Type:
    """Class decorator to log Qt events."""
    old_event = klass.event

    @functools.wraps(old_event)
    def new_event(self: typing.Any, e: QEvent) -> bool:
        """Wrapper for event() which logs events."""
        log.misc.debug("Event in {}: {}".format(utils.qualname(klass),
                                                qenum_key(QEvent, e.type())))
        return old_event(self, e)

    klass.event = new_event
    return klass 
開發者ID:qutebrowser,項目名稱:qutebrowser,代碼行數:15,代碼來源:debug.py

示例3: eventFilter

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def eventFilter(self, source, event):
        """
        Filters events if this object has been installed as an event filter for the watched object.
        :type source: QObject
        :type event: QtCore.QEvent
        :rtype: bool
        """
        if event.type() == QtCore.QEvent.Resize:
            widget = source.widget()
            widget.redraw()
        return super().eventFilter(source, event)

    #############################################
    #   SLOTS
    ################################# 
開發者ID:danielepantaleone,項目名稱:eddy,代碼行數:17,代碼來源:palette.py

示例4: leaveEvent

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def leaveEvent(self, event: QEvent) -> None:

        self.returnCursorToNormal() 
開發者ID:CountryTk,項目名稱:Hydra,代碼行數:5,代碼來源:foldArea.py

示例5: leaveEvent

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def leaveEvent(self, event: QEvent) -> None:

        self.editor.returnCursorToNormal()
        super().leaveEvent(event) 
開發者ID:CountryTk,項目名稱:Hydra,代碼行數:6,代碼來源:Content.py

示例6: enterEvent

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def enterEvent(self, evt: QtCore.QEvent) -> None:
        shadow = QGraphicsDropShadowEffect(self)
        shadow.setBlurRadius(8)
        shadow.setColor(QtGui.QColor(76, 35, 45).lighter())
        shadow.setOffset(4)
        self.setGraphicsEffect(shadow)
        super(SwitchButton, self).enterEvent(evt) 
開發者ID:haruiz,項目名稱:CvStudio,代碼行數:9,代碼來源:switch_button.py

示例7: leaveEvent

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def leaveEvent(self, evt: QtCore.QEvent) -> None:
        self.setGraphicsEffect(self._effect)
        super(SwitchButton, self).leaveEvent(evt) 
開發者ID:haruiz,項目名稱:CvStudio,代碼行數:5,代碼來源:switch_button.py

示例8: enterEvent

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def enterEvent(self, evt: QtCore.QEvent) -> None:
        self._hover_thread = HoverThread()
        self._hover_thread.start()
        self._hover_thread.signals.timeoutSignal.connect(self.timeout_callback)
        super(LabelHovered, self).enterEvent(evt) 
開發者ID:haruiz,項目名稱:CvStudio,代碼行數:7,代碼來源:label_hovered.py

示例9: leaveEvent

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def leaveEvent(self, evt: QtCore.QEvent) -> None:
        if self._hover_thread:
            self._hover_thread.join()
            del self._hover_thread
            super(LabelHovered, self).leaveEvent(evt) 
開發者ID:haruiz,項目名稱:CvStudio,代碼行數:7,代碼來源:label_hovered.py

示例10: enterEvent

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def enterEvent(self, evt: QtCore.QEvent) -> None:
        # self.setIconSize(QSize(math.floor(self._size.width() * 1.2),math.floor(self._size.height() * 1.2)))
        shadow = QGraphicsDropShadowEffect(self)
        shadow.setBlurRadius(8)
        # shadow.setColor(QtGui.QColor(76,35,45).lighter())
        shadow.setColor(QtGui.QColor(76, 35, 45).lighter())
        shadow.setOffset(4)
        self.setGraphicsEffect(shadow)
        super(ImageButton, self).enterEvent(evt) 
開發者ID:haruiz,項目名稱:CvStudio,代碼行數:11,代碼來源:image_button.py

示例11: edit

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def edit(self, index: QModelIndex, trigger: QAbstractItemView.EditTrigger, event: QEvent):
        if index.column() == 0:
            super(QTreeWidget, self).edit(index, trigger, event)
        return False 
開發者ID:autokey,項目名稱:autokey,代碼行數:6,代碼來源:autokey_treewidget.py

示例12: leaveEvent

# 需要導入模塊: from PyQt5 import QtCore [as 別名]
# 或者: from PyQt5.QtCore import QEvent [as 別名]
def leaveEvent(self, event: QEvent):
        super().leaveEvent(event)
        if isinstance(self.scene(), GridScene):
            self.scene().clear_frequency_marker() 
開發者ID:jopohl,項目名稱:urh,代碼行數:6,代碼來源:LiveGraphicView.py


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