1

I want to allow my app to expose functions to the dbus. I generated the following xml for my class:

<!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="local.ConnectionController">
    <method name="onSetConnection">
      <arg name="keyname" type="s" direction="in"/>
      <arg name="connected" type="b" direction="in"/>
    </method>
  </interface>
</node>

How ever when I try to run the xml2cpp generator I get no error message no output, nothing the process does not even exit.

qdbusxml2cpp -a controller.xml

When using the verbose option I get no output either. I am using qdbusxml2cpp version 0.8.

Why does the tool not do anything?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
faxe1008
  • 35
  • 7

1 Answers1

1

The problem is that the .xml must be before the "-a" option and put the file name after "-a":

qdbusxml2cpp controller.xml -a name_of_file
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • In addition to this answer, I would add that you can add `DBUS_ADAPTORS=controller.xml` to your [project.pro](https://code.qt.io/cgit/qt/qtbase.git/tree/examples/dbus/chat/chat.pro?h=5.13) if you use qmake, or you may use the [QT5_ADD_DBUS_ADAPTOR()](https://doc-snapshots.qt.io/qt5-5.12/qtdbus-cmake-qt5-add-dbus-adaptor.html) macro to your CMakeLists.txt if you prefer cmake. – Former contributor Oct 21 '19 at 14:27