views:

35

answers:

1

I have a Qt/C++ application that exposes some custom C++ classes via DBus methods (by registering them as MetaTypes, and using annotations in the xml), and I want my PyQt program to consume these methods.

The problem I see is that the exposed types are C++ classes, not python, so how can I make python aware of these classes?

A: 

There is no such thing as 'C++ classes' in D-Bus, it is language-agnostic. All methods, functions, etc. have type signatures expressible in basic D-Bus types (see the spec). Just call those classes, and it should work.

abbot
The point of registering custom classes with Qt's Dbus system is so I can use them in dbus methods and Qt will handle the serialization behind the scenes. I want to achieve the same abstraction in my python client. It doesn't "just work".
Casey
Python's DBus library does handle all the serialization itself. You don't have to declare anything or register anything in advance to consume a C++ DBus interface in python. You do not need any adapter or interface classes as in C++. Read the dbus-python tutorial carefully, and try to call your C++ methods from python like they do in the tutorial.
abbot