Hi. I have a Project where I am using a DBus Interface that is already specified (See attached sample project for xml). What I do ist, i specify a dictionary of 2 strings as a QMap<QString,QString> with an annotation like this:
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QMap<QString,QString>"/>
<arg direction="out" type="a{ss}" name="contents" />
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QMap<QString,QString>"/>
<arg direction="out" type="a{ss}" name="contents" />
To copy to clipboard, switch view to plain text mode
I then typedeffed the map and added it as a Metatype as well as registered it with DBus like this:
typedef QMap<QString,QString> StringMap;
Q_DECLARE_METATYPE(StringMap)
qDBusRegisterMetaType<StringMap>();
typedef QMap<QString,QString> StringMap;
Q_DECLARE_METATYPE(StringMap)
qDBusRegisterMetaType<StringMap>();
To copy to clipboard, switch view to plain text mode
When trying to compile the attached sample project however I get the following error message:
/usr/include/QtCore/qmetatype.h:169:80: error: ‘qt_metatype_id’ is not a member of ‘QMetaTypeId<QMap<QString, QString> >’
/usr/include/QtCore/qmetatype.h:169:80: error: ‘qt_metatype_id’ is not a member of ‘QMetaTypeId<QMap<QString, QString> >’
To copy to clipboard, switch view to plain text mode
So what am I doing wrong?
Bookmarks