aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-12-28 14:50:46 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:48:05 -0300
commit92b893c53242a191b76291f8fb0ce68fd284c115 (patch)
tree4a8e4e5da01122dc1e48e4a6aeb72c3fccbde7a5
parent6d18229268b42db54824cc277e339bac34ad3404 (diff)
Fix bug#563 - "Unhandled signal emitting with invalid signature (which leads to application crash)"
-rw-r--r--libpyside/signalmanager.cpp2
-rw-r--r--tests/QtDeclarative/bug_456.py2
-rw-r--r--tests/QtDeclarative/bug_456.qml2
-rw-r--r--tests/QtDeclarative/connect_python_qml.py6
-rw-r--r--tests/QtDeclarative/connect_python_qml.qml20
5 files changed, 16 insertions, 16 deletions
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 6cdc3e1bb..75a0d197f 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -188,7 +188,7 @@ static bool emitNormalSignal(QObject* source, int signalIndex, const char* signa
Shiboken::AutoDecRef sequence(PySequence_Fast(args, 0));
int argsGiven = PySequence_Fast_GET_SIZE(sequence.object());
- if (argsGiven > argTypes.count()) {
+ if (argsGiven != argTypes.count()) {
PyErr_Format(PyExc_TypeError, "%s only accepts %d arguments, %d given!", signal, argTypes.count(), argsGiven);
return false;
}
diff --git a/tests/QtDeclarative/bug_456.py b/tests/QtDeclarative/bug_456.py
index 262b82e48..9ed70c86f 100644
--- a/tests/QtDeclarative/bug_456.py
+++ b/tests/QtDeclarative/bug_456.py
@@ -33,7 +33,7 @@ class TestConnectionWithInvalidSignature(TimedQApplication):
root = view.rootObject()
button = root.findChild(QtCore.QObject, "buttonMouseArea")
view.show()
- button.clicked.emit()
+ button.entered.emit()
self.assertEqual(rotatevalue.rotation, 100)
if __name__ == '__main__':
diff --git a/tests/QtDeclarative/bug_456.qml b/tests/QtDeclarative/bug_456.qml
index e4596fdfb..e8b220ee9 100644
--- a/tests/QtDeclarative/bug_456.qml
+++ b/tests/QtDeclarative/bug_456.qml
@@ -56,7 +56,7 @@ Rectangle {
id: buttonMouseArea
objectName: "buttonMouseArea"
anchors.fill: parent
- onClicked: {
+ onEntered: {
rotatevalue.rotation = rotatevalue.val()
}
}
diff --git a/tests/QtDeclarative/connect_python_qml.py b/tests/QtDeclarative/connect_python_qml.py
index e8180f782..669eec653 100644
--- a/tests/QtDeclarative/connect_python_qml.py
+++ b/tests/QtDeclarative/connect_python_qml.py
@@ -19,9 +19,9 @@ class TestConnectionWithInvalidSignature(TimedQApplication):
view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('connect_python_qml.qml', __file__)))
root = view.rootObject()
button = root.findChild(QtCore.QObject, "buttonMouseArea")
- self.assertRaises(TypeError, QtCore.QObject.connect, [button,QtCore.SIGNAL('clicked()'), self.onButtonFailClicked])
- button.clicked.connect(self.onButtonClicked)
- button.clicked.emit()
+ self.assertRaises(TypeError, QtCore.QObject.connect, [button,QtCore.SIGNAL('entered()'), self.onButtonFailClicked])
+ button.entered.connect(self.onButtonClicked)
+ button.entered.emit()
view.show()
self.app.exec_()
self.assert_(self.buttonClicked)
diff --git a/tests/QtDeclarative/connect_python_qml.qml b/tests/QtDeclarative/connect_python_qml.qml
index dbf890f6f..df55e1b16 100644
--- a/tests/QtDeclarative/connect_python_qml.qml
+++ b/tests/QtDeclarative/connect_python_qml.qml
@@ -6,15 +6,15 @@ Rectangle {
color: "lightgray"
Rectangle {
- id: button
- width: 150; height: 40
- color: "darkgray"
- anchors.horizontalCenter: page.horizontalCenter
- y: 150
- MouseArea {
- id: buttonMouseArea
- objectName: "buttonMouseArea"
- anchors.fill: parent
- }
+ id: button
+ width: 150; height: 40
+ color: "darkgray"
+ anchors.horizontalCenter: page.horizontalCenter
+ y: 150
+ MouseArea {
+ id: buttonMouseArea
+ objectName: "buttonMouseArea"
+ anchors.fill: parent
+ }
}
}