I am working with QDBUS which has the custom type as Enum. After googling I found below link which explains marshalling of QDBUS custom types.
This doesnot explain the annotation to be specified in the QTDBUS interospection xml to generate proxy using qdbusxml2cpp.
How to add Enum annotations in QTDBUS interospection xml?
Please if possible explain with some sample code.
I found a solution for my problem:
First create a new header file called enums.h which looks like:
Note following line #include "enumDBus.h", you can find this header file here!
So after you declared the enum you can declare a method which takes the enum as argument, in this example I declared following method in calculator.h:
The implementation for this method:
Now let's generate the Interface description (xml), use following command
The generation of method which contains custom types doesn't work properply, so we need to do some adjustments:
With this xml file we can simply create our adaptors and interfaces classes.
In our main.cpp (on client and server!) we have to register our custom type:
Client Side
Include generated calculatorInterface.h and enums.h in your main.cpp.
Now you can simply call your method:
If everything worked you should see following output at your server programm: