Active Topics

 


Reply
Thread Tools
Posts: 239 | Thanked: 194 times | Joined on Jul 2010 @ Amsterdam
#21
The code would look as follows:

Code:
QDBusConnection::systemBus().connect(QString("org.freedesktop.Hal"), QString("/org/freedesktop/Hal/devices/platform_slide"), QString("org.freedesktop.Hal.Device"), QString("PropertyModified"), this, SLOT(slotKeyboardSlide()));
You might also want to retrieve the value from the dbus event:
Code:
    QDBusInterface propertyInterface("org.freedesktop.Hal", QString("/org/freedesktop/Hal/devices/platform_slide"), "org.freedesktop.Hal.Device", QDBusConnection::systemBus());
    bool pressed = propertyInterface.call("GetProperty", "button.state.value").arguments().at(0).toBool();
Bool holds the value.

You'll also need the following line in the .pro file:
Code:
QT += dbus
 
Reply


 
Forum Jump


All times are GMT. The time now is 09:28.