Congratulations to our 2022 Qt Champions!

Using QVariantMap with dbus

  • Hi there!

    I'm using the qdbus module and I'm quite happy with it. My plan was to use a QVariantMap as parameter and return type of a dbus function. The reason for this is because of the flexibility it offeres. I used the following example:

    Everything seems to work, but then I had another look at this:

    It states:

    bq. Warning: You may not use any type that is not on the list above, including typedefs to the types listed. This also includes QList<QVariant> and QMap<QString,QVariant>.

    Now I'm rather confused. Everything works fine with QVariantMap and there is even support in the automatic generation of sourcecode with qdbuscpp2xml and qdbusxml2cpp but the warning says the opposite.

    Does anybody know if QVariantMap is allowed in this context and what the reason for this warning is?

Log in to reply