PDA

View Full Version : Listening for a D-Bus signal



fabifi
30th January 2009, 16:27
Hi,

I can't get a D-Bus signal with my Qt4 Application;

I can sniff the signal with dbus-monitor:

signal sender=:1.34 -> dest=(null destination) path=/com/hal/wlan; interface=com.hal.wlan; member=status_changed
string "f889d396-fb71-4fa9-a319-6819525bc757"
string "WLAN_INFRA"
string "DISCONNECTING"
string ""

Could someone take a look to this code and explain me what is wrong and what's the is th solution.

signal sender=:1.34 -> dest=(null destination) path=/com/nokia/icd; interface=com.nokia.icd; member=status_changed
string "f889d396-fb71-4fa9-a319-6819525bc757"
string "WLAN_INFRA"
string "DISCONNECTING"
string ""
Interface = new QDBusInterface("com.hal.wlan", "/com/hal/wlan/com/hal/wlan", "com.hal.wlan", QDBusConnection::systemBus(), this);

Interface->connection().connect("com.hal.wlan", "/com/hal/wlan/com/hal/wlan", "com.hal.wlan", "status_changed", this, SLOT(mySlot())

Thank you in advance

Fabi

fabifi
1st February 2009, 10:13
I found what was wrong! :(
I forgot to add Q_OBJECT in the class declaration.
Now everything works fine.

I apologize.

Fabi