aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-08-17 15:49:55 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-08-17 16:59:15 -0300
commit23672770ea6fd79c38fed0695fc92ca193f0ece4 (patch)
treed3d1d82328e1a486f34c7ba38533f8639b0d09f5
parent9a969935ccc866804574480ac41ec004646f104c (diff)
Disable remove of QAbstractItemModel signals.
Fixes bug #300. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
-rw-r--r--PySide/QtCore/typesystem_core.xml13
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/bug_300_test.py17
3 files changed, 18 insertions, 13 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 2a5be3d13..571cc913d 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -985,19 +985,6 @@
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME(%1, %2, %PYARG_3));
</inject-code>
</add-function>
-
- <!-- These signals are private, because only QAbstractItemModel can emit then -->
- <modify-function signature="rowsAboutToBeInserted(const QModelIndex&amp;,int,int)" remove="all" />
- <modify-function signature="rowsInserted(const QModelIndex &amp;, int,int)" remove="all" />
- <modify-function signature="rowsAboutToBeRemoved(const QModelIndex &amp;, int, int)" remove="all" />
- <modify-function signature="rowsRemoved(const QModelIndex&amp;,int,int)" remove="all" />
- <modify-function signature="columnsAboutToBeInserted(const QModelIndex&amp;,int,int)" remove="all" />
- <modify-function signature="columnsInserted(const QModelIndex&amp;,int,int)" remove="all" />
- <modify-function signature="columnsAboutToBeRemoved(const QModelIndex&amp;,int,int)" remove="all" />
- <modify-function signature="columnsRemoved(const QModelIndex&amp;,int,int)" remove="all" />
- <modify-function signature="modelAboutToBeReset()" remove="all" />
- <modify-function signature="modelReset()" remove="all" />
-
</object-type>
<!-- QObject is created manually -->
<object-type name="QObject">
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 3b155dfa6..cf7727f45 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -1,4 +1,5 @@
PYSIDE_TEST(bug_278_test.py)
+PYSIDE_TEST(bug_300_test.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deletelater_test.py)
diff --git a/tests/QtCore/bug_300_test.py b/tests/QtCore/bug_300_test.py
new file mode 100644
index 000000000..ec02cdf02
--- /dev/null
+++ b/tests/QtCore/bug_300_test.py
@@ -0,0 +1,17 @@
+from PySide.QtGui import QStringListModel
+from PySide.QtCore import QModelIndex
+import unittest
+
+class TestQAbstractItemModelSignals(unittest.TestCase):
+ def sigCallback(self, index, r, c):
+ self._called = True
+
+ def testSignals(self):
+ self._called = False
+ m = QStringListModel()
+ m.rowsAboutToBeInserted[QModelIndex,int,int].connect(self.sigCallback)
+ m.insertRows(0, 3)
+ self.assert_(self._called)
+
+if __name__ == '__main__':
+ unittest.main()