本文整理汇总了Python中AnyQt.QtCore.QObject.customEvent方法的典型用法代码示例。如果您正苦于以下问题:Python QObject.customEvent方法的具体用法?Python QObject.customEvent怎么用?Python QObject.customEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyQt.QtCore.QObject
的用法示例。
在下文中一共展示了QObject.customEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: customEvent
# 需要导入模块: from AnyQt.QtCore import QObject [as 别名]
# 或者: from AnyQt.QtCore.QObject import customEvent [as 别名]
def customEvent(self, event):
QObject.customEvent(self, event)
if isinstance(event, SettingChangedEvent):
if event.type() == SettingChangedEvent.SettingChanged:
self.valueChanged.emit(event.key(), event.value())
elif event.type() == SettingChangedEvent.SettingAdded:
self.valueAdded.emit(event.key(), event.value())
elif event.type() == SettingChangedEvent.SettingRemoved:
self.keyRemoved.emit(event.key())
parent = self.parent()
if isinstance(parent, Settings):
# Assumption that the parent is a parent setting group.
parent.customEvent(
SettingChangedEvent(event.type(),
"/".join([self.__path, event.key()]),
event.value(),
event.oldValue())
)
示例2: customEvent
# 需要导入模块: from AnyQt.QtCore import QObject [as 别名]
# 或者: from AnyQt.QtCore.QObject import customEvent [as 别名]
def customEvent(self, event):
"""
Reimplemented from `QObject.customEvent`.
"""
if event.type() == StateChangedEvent.StateChanged:
if event.state() == Future.Canceled:
self.cancelled.emit()
elif event.state() == Future.Running:
self.started.emit()
elif event.state() == Future.Finished:
self.finished.emit()
return
return QObject.customEvent(self, event)