当前位置: 首页>>代码示例>>Python>>正文


Python ObjectType.processEvent方法代码示例

本文整理汇总了Python中sample.ObjectType.processEvent方法的典型用法代码示例。如果您正苦于以下问题:Python ObjectType.processEvent方法的具体用法?Python ObjectType.processEvent怎么用?Python ObjectType.processEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sample.ObjectType的用法示例。


在下文中一共展示了ObjectType.processEvent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testCpp

# 需要导入模块: from sample import ObjectType [as 别名]
# 或者: from sample.ObjectType import processEvent [as 别名]
    def testCpp(self):
        '''C++ calling C++ virtual method in multiple inheritance scenario'''
        obj = ImplementsNone()
        self.assert_(ObjectType.processEvent([obj], Event(Event.BASIC_EVENT)))
        self.assertRaises(AttributeError, getattr, obj, 'event_processed')

        self.assertEqual(obj.callSum0(1, 2, 3), 6)
开发者ID:Hasimir,项目名称:Shiboken,代码行数:9,代码来源:mi_virtual_methods_test.py

示例2: testEvent

# 需要导入模块: from sample import ObjectType [as 别名]
# 或者: from sample.ObjectType import processEvent [as 别名]
    def testEvent(self):
        '''C++ calling Python reimplementation of virtual in multiple inheritance'''
        obj = ImplementsBoth()
        self.assert_(ObjectType.processEvent([obj], Event(Event.BASIC_EVENT)))
        self.assert_(obj.event_processed)

        self.assertEqual(obj.callSum1(1, 2, 3), 12)
开发者ID:Hasimir,项目名称:Shiboken,代码行数:9,代码来源:mi_virtual_methods_test.py

示例3: testEventLoop

# 需要导入模块: from sample import ObjectType [as 别名]
# 或者: from sample.ObjectType import processEvent [as 别名]
    def testEventLoop(self):
        '''Calling virtuals in a event loop'''
        objs = [ObjectType(), NoOverride(), Override()]

        evaluated = ObjectType.processEvent(objs,
                                        Event(Event.BASIC_EVENT))

        self.assertEqual(evaluated, 3)
        self.assert_(objs[2].called)
开发者ID:BadSingleton,项目名称:shiboken2,代码行数:11,代码来源:event_loop_call_virtual_test.py

示例4: testBasic

# 需要导入模块: from sample import ObjectType [as 别名]
# 或者: from sample.ObjectType import processEvent [as 别名]
    def testBasic(self):
        '''Allowing threads and calling virtuals from C++'''
        number = 10
        objs = [Producer() for x in range(number)]
        thread = Collector(objs)

        thread.start()

        evaluated = ObjectType.processEvent(objs,
                                        Event(Event.BASIC_EVENT))

        thread.join()

        producer_data = [x.data for x in objs]
        self.assertEqual(evaluated, number)
        self.assertEqual(producer_data, thread.data)
开发者ID:BadSingleton,项目名称:shiboken2,代码行数:18,代码来源:event_loop_thread_test.py


注:本文中的sample.ObjectType.processEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。