本文整理汇总了Python中PySide2.QtCore.QObject.childEvent方法的典型用法代码示例。如果您正苦于以下问题:Python QObject.childEvent方法的具体用法?Python QObject.childEvent怎么用?Python QObject.childEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtCore.QObject
的用法示例。
在下文中一共展示了QObject.childEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testChildEventMonkeyPatch
# 需要导入模块: from PySide2.QtCore import QObject [as 别名]
# 或者: from PySide2.QtCore.QObject import childEvent [as 别名]
def testChildEventMonkeyPatch(self):
#Test if the new childEvent injected on QObject instance is called from C++
parent = QObject()
def childEvent(obj, event):
self.duck_childEvent_called = True
parent.childEvent = MethodType(childEvent, parent, QObject)
child = QObject()
child.setParent(parent)
self.assert_(self.duck_childEvent_called)
# This is done to decrease the refcount of the vm object
# allowing the object wrapper to be deleted before the
# BindingManager. This is useful when compiling Shiboken
# for debug, since the BindingManager destructor has an
# assert that checks if the wrapper mapper is empty.
parent.childEvent = None
示例2: childEvent
# 需要导入模块: from PySide2.QtCore import QObject [as 别名]
# 或者: from PySide2.QtCore.QObject import childEvent [as 别名]
def childEvent(self, event):
QObject.childEvent(self, event)
self.child_event_received = True
示例3: childEvent
# 需要导入模块: from PySide2.QtCore import QObject [as 别名]
# 或者: from PySide2.QtCore.QObject import childEvent [as 别名]
def childEvent(obj, event):
QObject.childEvent(obj, event)
self.duck_childEvent_called = True