[Qt-interest] Fwd: A Qt-dbus question

振华张 zhenhua2000 at gmail.com
Thu Sep 2 16:10:51 CEST 2010


Hi Thiago,

2010/9/2 Thiago Macieira <thiago at kde.org>:
> On Thursday 2. September 2010 04.43.34 振华张 wrote:
>> Attached is the compilable version of my problem. To reproduce my
>> problem, unzip and build the file. You may need copy myobject.conf to
>> /etc/dbus-1/system.d and restart dbus daemon.
>>
>> The key point is the parameter of MyMethod is "a(sy)" type. If I
>> change the parameter to a simple "s", everything works fine.
>
> This example has a(sy) with a type information of QString. That will never
> work, because a QString is not an array of (QString,byte).

Oops, you are right. It's a mistake during code modification. So I
change the xml back to "value=\"QArrayOfData\"", where QArrayOfData is
a METATYPE declared in myclass.h. However, the problem does still
exist. Could you help find any problems in my code? The updated
project is attached. Thanks!

struct MyData {
    QString text;
    uchar icon;
};

Q_DECLARE_METATYPE(MyData)

struct QArrayOfData {
    QList<MyData> items;
};

Q_DECLARE_METATYPE(QArrayOfData)

Regards,
Zhenhua

> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>  Senior Product Manager - Nokia, Qt Development Frameworks
>      PGP/GPG: 0x6EF45358; fingerprint:
>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus_adaptor_v1.tar.bz2
Type: application/x-bzip2
Size: 4083 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100902/d755f89f/attachment.bz2 


More information about the Qt-interest-old mailing list