From 080dafd0e50f63943bcf7f0b9e8cdd11b37a4230 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Mon, 21 Mar 2011 18:08:49 -0300 Subject: Fix bug 736 - "Signal/Slot is not working at all" Reviewer: Luciano Wolf Lauro Moura --- libpyside/pysidesignal.cpp | 2 +- tests/QtGui/CMakeLists.txt | 1 + tests/QtGui/bug_736.py | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/QtGui/bug_736.py diff --git a/libpyside/pysidesignal.cpp b/libpyside/pysidesignal.cpp index 1fe4b7f86..515b1a94a 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 76f3e06f6..ef9b9ac8b 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 000000000..49a954ccc --- /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() -- cgit v1.2.3