diff options
author | Renato Filho <renato.filho@openbossa.org> | 2010-02-18 11:14:41 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-02-18 21:11:04 -0300 |
commit | b2c5e91ff773591ce387effa0b77470fa2217c65 (patch) | |
tree | f02353eb63c90c3ce319e0c79e0db5f319136c47 /tests | |
parent | 0f2681523a65b34f6b1317ce48ceb1e55ed907b9 (diff) |
Fixed the number of dynamic signal to 50, to avoid index error on
QMetaObject functions.
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qtcore/qmetaobject_test.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/qtcore/qmetaobject_test.py b/tests/qtcore/qmetaobject_test.py index 8271a1f66..667e763ad 100644 --- a/tests/qtcore/qmetaobject_test.py +++ b/tests/qtcore/qmetaobject_test.py @@ -9,6 +9,10 @@ from PySide.QtCore import * class Foo(QFile): pass +class DynObject(QObject): + def slot(self): + pass + class qmetaobject_test(unittest.TestCase): def test_QMetaObject(self): qobj = QObject() @@ -27,6 +31,20 @@ class qmetaobject_test(unittest.TestCase): fm = f.metaObject() self.assertEqual(m.methodCount(), fm.methodCount()) + def test_DynamicSlotSignal(self): + o = DynObject() + o2 = QObject() + + method_count_base = o.metaObject().methodCount() + + o.connect(o2, SIGNAL("bar()"), o.slot) + slot_index = o.metaObject().indexOfMethod("slot()") + + o.connect(o, SIGNAL("foo()"), o2, SIGNAL("bar()")) + signal_index = o.metaObject().indexOfMethod("foo()"); + + self.assert_(slot_index != signal_index) + if __name__ == '__main__': unittest.main() |