[PyQt] Issue: PyQt5 can only connect to one D-Bus service, not two.

David Roberts ddr at krontech.ca
Fri Oct 5 02:59:23 BST 2018


Never mind, turned out I had to specify the paths differently. Just a
simple misunderstanding.

On Thu, Oct 4, 2018 at 6:41 PM David Roberts <ddr at krontech.ca> wrote:

> Hello. I'm pretty sure this is a bug, but I'm having trouble connecting to
> two D-Bus services at once. The second connection connects to the first
> service, although it claims to be correctly connected to the second service.
>
> I have detailed my findings on StackOverflow in the form of a question. <
> https://stackoverflow.com/questions/52657066/pyqt5-how-to-connect-to-two-d-bus-services-at-once>.
> I will, however, attach the minimal reproduction case here as well.
>
> In a nutshell, both result1 and result2 are the same after running the
> following code:
>
>     provider1API = QDBusInterface('com.krontech.chronos.control.mock',
> '/', '',
>         QDBusConnection.systemBus() )
>     provider2API = QDBusInterface('com.krontech.chronos.video.mock', '/',
> '',
>         QDBusConnection.systemBus() )
>
>     result1 = QDBusReply(provider1API.call('exampleCall')).value()
>     result2 = QDBusReply(provider2API.call('exampleCall')).value()
>
> result1 and result2 should be different, since they are connecting to two
> different D-Bus interfaces which return two different results.
>
> I am using Python 3.7, PyQt 5.11.2, and Qt 5.11.1 on Debian 7.
>
> Thank you,
> –DDR
>
> (Note: To enable D-Bus, you may need a D-Bus policy file. I have attached
> an example one, com.krontech.chronos.conf, but if you're not running Python
> as root you will need to change the username in it. The policy file goes in
> /etc/dbus-1/system.d/.)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20181004/3981e1f5/attachment.html>


More information about the PyQt mailing list