How to handle Notify signal with QDBusConnection::sessionBus().connect()?

1 day ago 6
ARTICLE AD BOX

With Qt5 and Qt6, I'm trying to handle the following signal:

QDBusConnectionPrivate() got message (signal): QDBusMessage(type=Signal, service=":1.10", path="/ca/desrt/dconf/Writer/user", interface="ca.desrt.dconf.Writer", member="Notify", signature="sass", contents=("/org/mate/desktop/interface/gtk-theme", {""}, ":1.10:user:xyz") )

So, to listen DBus messages I'm using the following code:

result = QDBusConnection::sessionBus().connect( "ca.desrt.dconf", "/ca/desrt/dconf/Writer/user", "ca.desrt.dconf.Writer", "Notify", this, SLOT(onDconfNotify(QString))); if (result) qDebug() << "started";

With Qt5 and Qt6, I get: "started".

When the signal is emitted, onDconfNotify is called with Qt 6. But with Qt 5.15, onDconfNotify is never called. I don't understand why... is someone can help?

Read Entire Article