QDbus, capture ProprietiesChange arguments not working
-
I'm trying to capture a dbus signal on my device and it doesn't work anymore. It worked fine when
proprietyChanged
function had to arguments but after I've tried adding them using an example I've found on stackoverflow it stopped working,dbus-monitor
method call time=1669374173.364583 sender=:1.32 -> destination=:1.82 serial=2375 path=/org/droidian/Flashlightd; interface=org.droidian.Flashlightd; member=SetBrightness uint32 0 signal time=1669374173.368365 sender=:1.82 -> destination=(null destination) serial=190 path=/org/droidian/Flashlightd; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged string "org.droidian.Flashlightd" array [ dict entry( string "Brightness" variant int32 0 ) ] array [ ] method return time=1669374173.368570 sender=:1.82 -> destination=:1.32 serial=191 reply_serial=2375
code
PowerControl::PowerControl(QObject *parent) : QObject(parent) { } PowerControl::~PowerControl() { } void PowerControl::start() { bool conn = QDBusConnection::sessionBus().connect("", "/org/droidian/Flashlightd", "org.freedesktop.DBus.Properties", "PropertiesChanged", this, SLOT( propertyChanged(QString, QVariantMap, QStringList) )); qDebug() << QDBusConnection::sessionBus().isConnected(); } void PowerControl::proprietyChanged(QString interface, QVariantMap changed_properties, QStringList invalidated_properties) { qDebug() << QString("properties of interface %1 changed").arg(name); for (QVariantMap::const_iterator it = map.cbegin(), end = map.cend(); it != end; ++it) { qDebug() << "property: " << it.key() << " value: " << it.value(); } }