I had the same problem and spent the whole day on it.
The only thing you need is to register the service before sending the signal from Qt.
It should look like this:
if (! connection.registerService("local.Widget"))
{
qDebug() << "Failed to register the service. Is it already registered?";
}
QDBusMessage message
=createsignal
("/",
"local.Widget",
"pong");
//pong is signal and local.Widget is an interface if(conncetion.send(message))
{
qDebug()<<"yes i can send the pong signal and see with dbus --monitor "<<endl;
}
if (! connection.registerService("local.Widget"))
{
qDebug() << "Failed to register the service. Is it already registered?";
}
QDBusMessage message=createsignal("/","local.Widget","pong"); //pong is signal and local.Widget is an interface
if(conncetion.send(message))
{
qDebug()<<"yes i can send the pong signal and see with dbus --monitor "<<endl;
}
To copy to clipboard, switch view to plain text mode
Bookmarks