Python Forum
PySide6 - Connect to DBus signal - Correct syntax
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PySide6 - Connect to DBus signal - Correct syntax
#1
Hello,

can you help me with the correct syntax to connect to a DBus signal?

This is one of my many tries which at least runs and matches the signature in the docs:

class MainWindow(QMainWindow):
    __slots__ = ["__mainwidget"]
    __mainwidget:QWidget

    def __init__ (self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        service = 'org.freedesktop.DBus'
        path = '/org/freedesktop/DBus'
        iface = 'org.freedesktop.DBus'
        conn = QtDBus.QDBusConnection.systemBus()
        conn.connect(service, path, iface, "NameOwnerChanged", self, "nochangeslot")
        #smp = QtDBus.QDBusInterface(service, path, iface, connection=QtDBus.QDBusConnection.systemBus()


    def nochangeslot(self, arg:object) -> None:
        print(arg)
        pass
But it doesn't work and looks weird with the slot as string...

On the output I see:
qt.dbus.integration: Could not connect "org.freedesktop.DBus" to ochangeslot

Thank you in advance for any help!
Reply


Messages In This Thread
PySide6 - Connect to DBus signal - Correct syntax - by Drexel - Dec-11-2023, 08:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PySide6 Copy and Past from clipboard to QTableWedget zinho 6 1,483 Dec-07-2023, 10:10 PM
Last Post: zinho
Bug [PyQt] Dinamically adding widgets to layout [PySide6] carecavoador 2 1,580 Jun-19-2023, 12:57 PM
Last Post: carecavoador
  PySide6 QFontDialog - bug or just me? PatM 1 1,167 Jan-22-2023, 01:29 PM
Last Post: Axel_Erfurt
  Pyside6 Larz60+ 7 3,163 Nov-28-2022, 07:25 PM
Last Post: Larz60+
  [PySide6] Load ui with UiLoader catlessness 6 9,110 Nov-24-2021, 02:17 PM
Last Post: catlessness

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020