QDBusContext / sending error replies via DBus

Florian Bruhin me at the-compiler.org
Mon Jun 20 17:15:17 BST 2022


Hey,

I currently have this working example of a DBus service implemented via
PyQt:
https://github.com/qutebrowser/qutebrowser/blob/master/tests/end2end/fixtures/notificationserver.py#L45

Now I'd like to return an error reply to the DBus client in certain
circumstances. How can I do that? With normal Qt code, one would
apparently inherit from QDBusContext instead of QObject, and use
sendErrorReply(): https://doc.qt.io/qt-6/qdbuscontext.html

    When a slot is called in an object due to a signal delivery or due
    to a remote method call, it is sometimes necessary to know the
    context in which that happened. In particular, if the slot
    determines that it wants to send the reply at a later opportunity or
    if it wants to reply with an error, the context is needed.

However, that class seems to be missing in both PyQt5 and PyQt6.

Florian

-- 
            me at the-compiler.org | https://www.qutebrowser.org 
       https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
       GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
             I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20220620/7af8d193/attachment.sig>


More information about the PyQt mailing list