Qdbus - can't connect to dbus signal with struct argument



  • Hi,
    I'm trying to connect to amarok d-bus signal StatusChange (reference: https://xmms2.org/wiki/MPRIS#StatusChange). Interface and struct is ok because I can connect to simple signal CapsChange(int) in same interface and can get status by GetStatus dbus method, so this marshall struct is ok:
    @struct AmarokStatus {
    int st1;
    int st2;
    int st3;
    int st4;
    };

    Q_DECLARE_METATYPE(AmarokStatus)
    qDBusRegisterMetaType<AmarokStatus>();@

    But when call:
    @mInf = new QDBusInterface("org.mpris.MediaPlayer2.amarok", "/Player",
    "org.freedesktop.MediaPlayer", QDBusConnection::sessionBus(),this);
    connect(mInf, SIGNAL(StatusChange(AmarokStatus)), this, SLOT(statusChanged(AmarokStatus)));
    connect(mInf, SIGNAL(CapsChange(int)), this, SLOT(capsChange(int)));@

    I got message:
    Object::connect: No such signal org::freedesktop::MediaPlayer::StatusChange(AmarokStatus)

    I have tried with signal( StatusChange( struct ) ) and signal( StatusChange( QDbusargument ) ) and other types but same message

    D-Feet is saying that definition of StatusChange is: StatusChange( Struct of ( Int32, Int32, Int32, Int32 ) ), same with dbus-monitor. And same problem with signal TrackChange(array of struct). So I'm definitely messing something with connect() method.

    Regards


Log in to reply
 

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