[Qt-interest] qdbus (qt4.6) issue running on Unbuntu
Wong, Carl
carl.wong at intel.com
Wed Mar 31 01:25:09 CEST 2010
I have an issue with qdbus and not sure if it is a bug in my code or in qdbus itself.
I have a remote method that takes 2 "In" parameters. Here is the xml snippet for the method:
<method name="Sync">
<arg type="s" name="mode" direction="in" />
<arg type="a{ss}" name="sources" direction="in">
<annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="QStringMap"/>
</method>
I have QStringMap define as follow:
typedef QMap<QString, QString > QStringMap;
Q_DECLARE_METATYPE ( QStringMap )
And I register the type by calling qDBusRegisterMetaType< QStringMap >()';
In my client code when I make a call to the remote method Sync, it failed and the error was bad signature. I ran dbus-monitor and it show the following error:
Method "Sync" with signature "sa{ss}" on interface "org.syncevolution.Session" doesn't exist
It appears to me that qdbus is not encoding the data correctly before send the request over the wire. Looks like it packed the 2 parameters into one. My question is do I have to create the "<<" and ">>" operators for my custom type QStringMap. From what I read, I shouldn't have to since QStringMap is just a QMap<QString, QString >. And I have no problem with the out parameter using the same custom type.
Any help would be greatly appreciated!!
Thanks,
Carl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100330/6ae40bbb/attachment.html
More information about the Qt-interest-old
mailing list