Results 1 to 2 of 2

Thread: Listening for a D-Bus signal

  1. #1
    Join Date
    Jan 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Listening for a D-Bus signal

    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

  2. #2
    Join Date
    Jan 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Cool Re: Listening for a D-Bus signal

    I found what was wrong!
    I forgot to add Q_OBJECT in the class declaration.
    Now everything works fine.

    I apologize.

    Fabi

Similar Threads

  1. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  2. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 07:04
  3. Possible signal mapper problem
    By MarkoSan in forum Qt Programming
    Replies: 13
    Last Post: 25th January 2008, 13:11
  4. Replies: 2
    Last Post: 17th May 2006, 21:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.