Results 1 to 2 of 2

Thread: qdbusxml2cpp unkown type must add annotation

  1. #1
    Join Date
    Jul 2012
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default qdbusxml2cpp unkown type must add annotation

    While using the qdbusxml2cpp program to convert the following xml to a Qt Class, I am getting this error:

    Qt Code:
    1. qdbusxml2cpp -c ObjectManager -a ObjectManager:ObjectManager.cpp xml/object_manager.xml
    2. Got unknown type `a{oa{sa{sv}}}'
    3. You should add <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="<type>"/> to the XML description
    To copy to clipboard, switch view to plain text mode 

    D-Feet description:

    dbus.jpg

    XML:

    Qt Code:
    1. <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
    2. "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
    3. <node><interface name="org.freedesktop.DBus.Introspectable"><method name="Introspect"><arg name="xml" type="s" direction="out"/>
    4. </method></interface><interface name="org.freedesktop.DBus.ObjectManager"><method name="GetManagedObjects"><arg name="objects" type="a{oa{sa{sv}}}" direction="out"/>
    5. </method><signal name="InterfacesAdded"><arg name="object" type="o"/>
    6. <arg name="interfaces" type="a{sa{sv}}"/>
    7. </signal>
    8. <signal name="InterfacesRemoved"><arg name="object" type="o"/>
    9. <arg name="interfaces" type="as"/>
    10. </signal>
    11. </interface><node name="org"/></node>
    To copy to clipboard, switch view to plain text mode 

    From this website ( http://techbase.kde.org/Development/...us/CustomTypes ) I understand that I need to add an annotation to the XML for the tool to work properly.

    Qt Code:
    1. a{oa{sa{sv}}}
    2.  
    3. https://alteeve.ca/w/List_of_DBus_data_types
    4. o == A UTF-8 string whose value is a valid DBus object path.
    5.  
    6. array { object_path array { string array { string variant } } }
    7.  
    8. <arg name="customdata" type="a{sv}" direction="in" />
    9. QVariantMap in the arguments (type "a{sv}")
    10. QMap<QString, QVariant>
    To copy to clipboard, switch view to plain text mode 

    However, I'm not sure what the annotation should be for a{oa{sa{sv}}}, can someone please help me understand? Thanks!
    Last edited by phil999; 7th March 2014 at 16:56.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qdbusxml2cpp unkown type must add annotation

    The type you seem to have here is

    Qt Code:
    1. QMap<QDBusObjectPath, QMap<QString, QMap<QString, QVariant> > >
    To copy to clipboard, switch view to plain text mode 

    What you likely need is a class type that implementes the D-Bus stream operators to serialize and deserialize the type into this form and then register it.

    Bascially like the Message class in the TechBase article.

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 27th November 2013, 01:56
  2. unkown toolchain
    By taku in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 31st August 2011, 14:21
  3. Replies: 7
    Last Post: 19th April 2011, 13:20
  4. Replies: 2
    Last Post: 22nd December 2009, 21:52
  5. 'Annotation' of lines in a QTextEdit
    By caduel in forum Qt Programming
    Replies: 21
    Last Post: 23rd June 2007, 16:29

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.