Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.8.0
-
None
Description
Generated adaptors do not forward calls to the parent
when there is more than 1 return value.
Also it's not recommended to edit the generated code manually
(the generated file contains a comment "Do not edit! All changes made to it will be lost.")
How to deal with methods returning more than 1 argument?
Example:
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> <node> <interface name="com.example.SampleInterface0"> <method name="Foo1Out"> <arg name="result0" type="s" direction="out"/> </method> <method name="Foo2Out"> <arg name="result0" type="s" direction="out"/> <arg name="result1" type="s" direction="out"/> </method> </interface> </node>
This is the generated code (
Foo1Out => OK
Foo2Out => NOK, just comments are being generated
):
QString SampleInterface0Adaptor::Foo1Out() { // handle method call com.example.SampleInterface0.Foo1Out QString result0; QMetaObject::invokeMethod(parent(), "Foo1Out", Q_RETURN_ARG(QString, result0)); return result0; } QString SampleInterface0Adaptor::Foo2Out(QString &result1) { // handle method call com.example.SampleInterface0.Foo2Out //return static_cast<YourObjectType *>(parent())->Foo2Out(result1); }
At least I would expect something like
#error "Cannot handle more than 1 return argument"
instead of a comment which depends on compiler settings if just a warning about missing return statement is generated or if this is handled as a compile eror.