summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-07-27 19:24:54 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2011-07-28 14:03:04 -0300
commitf918fdb490e62ff4a2860058edb0cf0d7b7e6c6f (patch)
treee76cbe08eabfc6981ca621a565f19ca264b07b31 /tests
parent4f873e6f7918ab0e96e8be4861694ff1936b7bdd (diff)
downloadpyside-f918fdb490e62ff4a2860058edb0cf0d7b7e6c6f.tar.gz
pyside-f918fdb490e62ff4a2860058edb0cf0d7b7e6c6f.tar.xz
pyside-f918fdb490e62ff4a2860058edb0cf0d7b7e6c6f.zip
Fix bug 941 - "Signals with QtCore.Qt types as arguments has invalid signatures"
Reviewer: Renato Ara├║jo <renato.filho@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_941.py17
-rw-r--r--tests/pysidetest/typesystem_pysidetest.xml19
3 files changed, 24 insertions, 13 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 99e688b..9e5b0c3 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -68,6 +68,7 @@ PYSIDE_TEST(bug_879.py)
PYSIDE_TEST(bug_882.py)
PYSIDE_TEST(bug_919.py)
PYSIDE_TEST(bug_921.py)
+PYSIDE_TEST(bug_941.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(event_filter_test.py)
diff --git a/tests/QtGui/bug_941.py b/tests/QtGui/bug_941.py
new file mode 100644
index 0000000..cdf1190
--- /dev/null
+++ b/tests/QtGui/bug_941.py
@@ -0,0 +1,17 @@
+import unittest
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+def foo(a, b):
+ pass
+
+class TestBug941 (unittest.TestCase):
+
+ def testIt(self):
+ app = QApplication([])
+ view = QHeaderView(Qt.Horizontal)
+ self.assertTrue(view.sortIndicatorChanged.connect(foo))
+ view.sortIndicatorChanged.emit(0, Qt.Vertical) # this can't raise an exception!
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/pysidetest/typesystem_pysidetest.xml b/tests/pysidetest/typesystem_pysidetest.xml
index c63d5e1..88cbf03 100644
--- a/tests/pysidetest/typesystem_pysidetest.xml
+++ b/tests/pysidetest/typesystem_pysidetest.xml
@@ -4,30 +4,23 @@
<load-typesystem name="typesystem_gui.xml" generate="no"/>
<object-type name="TestObject" />
- <inject-code>
+ <inject-code position="end">
+ Shiboken::TypeResolver::createObjectTypeResolver&lt; ::PySideCPP2::TestObjectWithoutNamespace>("TestObjectWithoutNamespace*");
+ Shiboken::TypeResolver::createValueTypeResolver&lt; ::PySideCPP2::PySideLong>("PySideLong");
+ Shiboken::TypeResolver::createObjectTypeResolver&lt; ::PySideCPP::TestObjectWithNamespace>("TestObjectWithNamespace*");
+ Shiboken::TypeResolver::createValueTypeResolver&lt; ::PySideInt>("PySideInt");
qRegisterMetaType&lt;PySideInt>("PySideInt");
qRegisterMetaType&lt;PySideCPP2::PySideLong>("PySideLong");
</inject-code>
<namespace-type name="PySideCPP">
- <object-type name="TestObjectWithNamespace" >
- <modify-function signature="emitSignal(PySideCPP::TestObjectWithNamespace*)">
- <modify-argument index="1">
- <replace-type modified-type="TestObjectWithNamespace*"/>
- </modify-argument>
- </modify-function>
- </object-type>
+ <object-type name="TestObjectWithNamespace" />
</namespace-type>
<namespace-type name="PySideCPP2" generate="no">
<enum-type name="Enum1" />
<object-type name="TestObjectWithoutNamespace" >
<enum-type name="Enum2" />
- <modify-function signature="emitSignalWithNamespace(PySideCPP2::TestObjectWithoutNamespace*)">
- <modify-argument index="1">
- <replace-type modified-type="PySideCPP2::TestObjectWithoutNamespace*"/>
- </modify-argument>
- </modify-function>
</object-type>
</namespace-type>