summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-03-21 18:08:49 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2011-03-22 15:04:40 -0300
commit7849b4262ff33407274c3aa17747bba43cfd390d (patch)
tree351489df3f01879269172049b8c1dfbadecd33e1
parent4749d146426e5b937f121963424d5613aaa0fcb9 (diff)
downloadpyside-7849b4262ff33407274c3aa17747bba43cfd390d.tar.gz
pyside-7849b4262ff33407274c3aa17747bba43cfd390d.tar.xz
pyside-7849b4262ff33407274c3aa17747bba43cfd390d.zip
Fix bug 736 - "Signal/Slot is not working at all"
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
-rw-r--r--libpyside/pysidesignal.cpp2
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_736.py19
3 files changed, 21 insertions, 1 deletions
diff --git a/libpyside/pysidesignal.cpp b/libpyside/pysidesignal.cpp
index 1fe4b7f..515b1a9 100644
--- a/libpyside/pysidesignal.cpp
+++ b/libpyside/pysidesignal.cpp
@@ -736,7 +736,7 @@ QString getCallbackSignature(const char* signal, QObject* receiver, PyObject* ca
numArgs = objCode->co_flags & CO_VARARGS ? -1 : objCode->co_argcount;
} else if (PyCFunction_Check(callback)) {
functionName = ((PyCFunctionObject*)callback)->m_ml->ml_name;
- useSelf = ((PyCFunctionObject*)callback)->m_self;
+ useSelf = 0;//((PyCFunctionObject*)callback)->m_self; // commented out to fix bug 736
int flags = ((PyCFunctionObject*)callback)->m_ml->ml_flags;
if (receiver) {
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 76f3e06..ef9b9ac 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -45,6 +45,7 @@ PYSIDE_TEST(bug_696.py)
PYSIDE_TEST(bug_693.py)
PYSIDE_TEST(bug_714.py)
PYSIDE_TEST(bug_728.py)
+PYSIDE_TEST(bug_736.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/bug_736.py b/tests/QtGui/bug_736.py
new file mode 100644
index 0000000..49a954c
--- /dev/null
+++ b/tests/QtGui/bug_736.py
@@ -0,0 +1,19 @@
+import unittest
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+class TestBug736 (unittest.TestCase):
+
+ def testIt(self):
+ app = QApplication([])
+ slider = QSlider(Qt.Horizontal)
+ slider2 = QSlider(Qt.Horizontal)
+
+ slider2.setMaximum(10)
+ slider.valueChanged[int].connect(slider2.setMaximum)
+ slider.valueChanged[int].emit(100)
+ self.assertEqual(slider2.maximum(), 100)
+
+
+if __name__ == '__main__':
+ unittest.main()