[solved] Receiving D-Bus signals in QML

Suspecting there may be something weird about the code in my initial program I’ve created one (from an example) in a completely different language to ensure it’s not something with the particular d-bus library I’m using.

Still no luck even in Python:

import dbus
import dbus.service
import dbus.mainloop.glib
import time

class TestObject(dbus.service.Object):
    def __init__(self, conn, object_path='/application'):
        dbus.service.Object.__init__(self, conn, object_path)

    @dbus.service.signal('uk.co.piggz.amazfish2', signature='is')
    def informationChanged(self, value, message):
      pass


if __name__ == '__main__':
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

    session_bus = dbus.SessionBus()
    name = dbus.service.BusName('uk.co.piggz.amazfish2', session_bus)
    object = TestObject(session_bus)

    while True:
      time.sleep(1)
      object.informationChanged(1, "test")
1 Like