QtDBus bindings: transparent usage

Thiago Macieira thiago at kde.org
Mon Oct 16 09:14:45 PDT 2006

Sebastian Trüg wrote:
>On Monday 16 October 2006 16:13, Thiago Macieira wrote:
>> Sebastian Trüg wrote:
>> >I have a frontend library that hides DBus (thus, in theory once could
>> > replace dbus with something else without changing the API). This is
>> > no problem as long as I am just using clients that call methods.
>> > However, if I want to export methods I have a little problem becasue
>> > these methods need to be inserted into an AbstractAdaptor which will
>> > not be available in the API.
>> >
>> >Is there a clean way to handle this? Maybe using some meta-object
>> > magic?
>> You can easily export slots, signals and properties of any given
>> QObject. So, I recommend that you use that method of construction:
>> create your own hierarchy of QObject with the exportable methods.
>But I need to know the methods of that object at compile-time, right?

Yes. There's no way to add or remove methods at run-time.

>> [Hint: making them Q_SCRIPTABLE and using the ExportScriptableSlots
>> flag makes it easy to distinguish which slots are meant to be
>> exported.]
>How do I use that? Just like so:
>Q_SCRIPTABLE QString whatever();

Yes, in a "public slots" section.

  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20061016/25b71c8c/attachment-0001.pgp

More information about the dbus mailing list