[SOLVED] Qt DBus signal not arriving



  • We are using a DBus interface (QDBusAbstractInterface) with this signal:
    @ <signal name="ContentUpdated">
    <doc>
    <line>ContentUpdated = This signal updates the input content data for the specified session</line>
    </doc>
    <arg name="locationInputHandle" type="y" direction="out" />
    <arg name="guidable" type="b" direction="out" />
    <arg name="availableSelectionCriteria" type="aq" direction="out" />
    <arg name="address" type="a{qv}" direction="out" />
    </signal>
    @

    Using qdbusxml2cpp it is translated to this interface:
    @Q_SIGNALS:
    void sgnContentUpdated(quint8 locationInputHandle, bool guidable, TUshortList availableSelectionCriteria, TUshortVariantMap address);
    @

    For some reason, when i use the TUShortVariantMap in a QVariant::setValue() call the signal does not arrive anymore.
    Below is the code where i do this. So without this code, and in particular the call to QVariant::setValue(), the ContentUpdates signal arrives without problems.

    @
    void CGuidanceHandler::updateAdr(const quint32 aCurrentRouteOffset, const CRoadBookItem& aCurrentInstruction)
    {
    TUshortVariantMap valueOnRoute;
    QDBusVariant offsetValue;
    offsetValue.setVariant(QVariant(aCurrentRouteOffset));
    valueOnRoute.insert(GENIVI_MAPDATAACCESS_OFFSET, offsetValue);

    QDBusVariant value;
    QVariant innerValue;
    innerValue.setValue(valueOnRoute); // This call results in the signal not arriving anymore
    value.setVariant(innerValue);

    // etc..
    }
    @

    Any ideas why this can cause the signal not arriving anymore?
    Or any other pointers why signals could not be arriving?



  • I found the problem. I noticed that there was no Q_DECLARE_METATYPE call on the type in the main library, only in the QServicePlugin which is a different library.

    This was fixed after i added the Q_DECLARE_METATYPE call in the main library.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.