Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-61371

qdbusxml2cpp: Adaptor not working for >1 return arguments:

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 5.8.0
    • Fix Version/s: None
    • Component/s: D-Bus
    • Labels:
      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.

       

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              thiago Thiago Macieira
              Reporter:
              m_ertl Martin Ertl
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes