Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDbus, capture ProprietiesChange arguments not working
Forum Updated to NodeBB v4.3 + New Features

QDbus, capture ProprietiesChange arguments not working

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 268 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    marcelnitan
    wrote on last edited by
    #1

    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();
            }
    }
     
    
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved