Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How is the "car.xml" file from dbus example called "D-Bus remote controlled car example" generated?
Forum Updated to NodeBB v4.3 + New Features

How is the "car.xml" file from dbus example called "D-Bus remote controlled car example" generated?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    morkia
    wrote on last edited by
    #1

    I am trying to create programs that take advantage of the D-Bus. I've studied the examples supplied with Qt about the same. In one of them called "D-Bus remote controlled car example" there is a file named "car.xml" with following content:

    @<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
    "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
    <node name="/com/trollech/examples/car">
    <interface name="org.example.Examples.CarInterface">
    <method name="accelerate"/>
    <method name="decelerate"/>
    <method name="turnLeft"/>
    <method name="turnRight"/>
    <signal name="crashed"/>
    </interface>
    </node>@

    If I'm not mistaken, one is supposed to generate this file using a tool named "qdbuscpp2xml". when i generate an xml using this command:

    @$ qdbuscpp2xml -A car.h -o car2.xml@

    i get the following content in the generated XML file:

    @<!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.Car">
    <signal name="crashed">
    </signal>
    <method name="accelerate">
    </method>
    <method name="decelerate">
    </method>
    <method name="turnLeft">
    </method>
    <method name="turnRight">
    </method>
    </interface>
    </node>@

    which differs from the car.xml in following lines:

    @<node name="/com/trollech/examples/car">
    <interface name="org.example.Examples.CarInterface">@

    why am I getting a different file? was the included file (car.xml) with the example created manually?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      morkia
      wrote on last edited by
      #2

      so as i have come to conclude, the first line which is:

      @<node name="/com/trollech/examples/car">@

      is edited manually and the second line is automatically generated by including:

      @Q_CLASSINFO("D-Bus Interface", "org.example.Examples.CarInterface")@

      in the header of the class one would like to export before using the qdbuscpp2xml tool.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved