diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-07-15 19:01:22 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:36 -0300 |
commit | e6f0d69532fffb19befde41ab6155ca87a0390a0 (patch) | |
tree | 68df6010a75ac4b889af791866d143edbc18960a /tests/QtCore | |
parent | 420cc076b36bea4c956db744aae986b67e702ce9 (diff) |
Created unit test for bug #921.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'tests/QtCore')
-rw-r--r-- | tests/QtCore/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtCore/bug_921.py | 52 |
2 files changed, 53 insertions, 0 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt index 2c99cf1b2..d3048a3fd 100644 --- a/tests/QtCore/CMakeLists.txt +++ b/tests/QtCore/CMakeLists.txt @@ -17,6 +17,7 @@ PYSIDE_TEST(bug_826.py) PYSIDE_TEST(bug_829.py) PYSIDE_TEST(bug_835.py) PYSIDE_TEST(bug_920.py) +PYSIDE_TEST(bug_921.py) PYSIDE_TEST(bug_927.py) PYSIDE_TEST(blocking_signals_test.py) PYSIDE_TEST(classinfo_test.py) diff --git a/tests/QtCore/bug_921.py b/tests/QtCore/bug_921.py new file mode 100644 index 000000000..b43f5b3d2 --- /dev/null +++ b/tests/QtCore/bug_921.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python + +import unittest + +import PySide.QtCore as QtCore +import PySide.QtGui as QtGui + +from helper import TimedQApplication + +class Signaller(QtCore.QObject): + s1 = QtCore.Signal() + s2 = QtCore.Signal() + s3 = QtCore.Signal() + +class Window(object): + + def __init__(self, s): + self._window = QtGui.QMainWindow() + self._window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True) + self._window.setWindowTitle("Demo!") + + self._s = s + self._s.s1.connect(self._on_signal) + self._s.s2.connect(self._on_signal) + + def show(self): + self._window.show() + + def _on_signal(self): + self._window.setWindowTitle("Signaled!") + +class TestTimedApp(TimedQApplication): + def testSignals(self): + s = Signaller() + w = Window(s) + w.show() + + def midleFunction(): + def internalFunction(): + pass + s.s3.connect(internalFunction) + + midleFunction() + self.app.exec_() + del w + + s.s1.emit() + s.s2.emit() + s.s3.emit() + +if __name__ == '__main__': + unittest.main() |