当前位置: 首页>>代码示例>>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;未经允许,请勿转载。