PySide/tests/QtGui/qdynamic_signal.py
Marcelo Lira ee8d6262dc Fixed new style signal connection tests for the proper semantics.
One example to clarify: for the "destroyed(QObject* = 0)" signal,
"obj.destroyed.connect(...)" connects to "destroyed()", and
"obj.destroyed[QObject].connect(...)" connects to "destroyed(QObject*)".

Reviewed by Lauro Moura <lauro.neto@openbossa.org>
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
2012-03-08 16:47:57 -03:00

28 lines
606 B
Python

import unittest
from PySide.QtCore import QObject
from PySide.QtGui import QInputDialog
from helper import UsesQApplication
class DynamicSignalTest(UsesQApplication):
def cb(self, obj):
self._called = True
def testQDialog(self):
dlg = QInputDialog()
dlg.setInputMode(QInputDialog.TextInput)
lst = dlg.children()
self.assert_(len(lst))
obj = lst[0]
self._called = False
obj.destroyed[QObject].connect(self.cb)
obj = None
del dlg
self.assert_(self._called)
if __name__ == '__main__':
unittest.main()