PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 1003 - QMetaObject::invokeMethod always returns false when used with return argument
: QMetaObject::invokeMethod always returns false when used with return argument
Status: CLOSED INVALID
Product: PySide
Classification: Unclassified
Component: QtCore
: 1.0.1
: PC Linux
: P5 major
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-09-09 22:17 EEST by Dirk Thomas
Modified: 2011-09-21 21:19 EEST (History)
9 users (show)

See Also:


Attachments
example which demonstrates the problem (1.71 KB, application/x-bzip)
2011-09-09 22:17 EEST, Dirk Thomas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Thomas 2011-09-09 22:17:47 EEST
Created attachment 420 [details]
example which demonstrates the problem

When the QMetaObject::invokeMethod is used with a QGenericReturnArgument on a
Python QObject it always returns false.
Obviously the method is not called.

If no arguments are used or only QGenericArgument's it works as expected.

Please find attached in minimal example which shows the problem.
To run the attached example do:
- cd build
- cmake ../
- make
- cd ../lib
- ./main

Actual result:
PythonA.testOne()
invoke testOne - ok
PythonA.testTwo()
invoke testTwo - ok
invoke testThree - failed

Expected result:
PythonA.testOne()
invoke testOne - ok
PythonA.testTwo()
invoke testTwo - ok
PythonA.testThree()
invoke testThree - ok
Comment 1 Hugo Parente Lima 2011-09-12 17:09:21 EEST
The keyword used to specify return value is "result", not "ret", if you change
line 16 of PythonA.py from:

    @Slot(ret = int)


to:

    @Slot(result = int)

it will work as expected.

Regards.
Comment 2 Dirk Thomas 2011-09-19 12:39:29 EEST
Ok, with the "correct" code it works as suggested.
Would it be possible to print a warning with states that the signature does not
match? In other cases (wrong arguments count/type) this is already the case.
Comment 3 Hugo Parente Lima 2011-09-19 16:02:34 EEST
(In reply to comment #2)
> Ok, with the "correct" code it works as suggested.
> Would it be possible to print a warning with states that the signature does not
> match? In other cases (wrong arguments count/type) this is already the case.

Yes, but it would penalize the speed of all well formed code in favor of the
malformed ones, so IMO is better you write more unit tests to catch those typos
;-).
Comment 4 renato filho 2011-09-21 21:19:52 EEST
Release 1.0.7