aboutsummaryrefslogtreecommitdiffstats
path: root/doc/dbus.rst
blob: 0e57d0b87b266462be4b4054414b89525f4f740a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
DBUS integration
****************

To get PySide and DBus working toghether you can use the glib mainloop integration already done in pydbus.

The example above show how to export Qt objects to python and emit an DBus signal when a Qt signal is emited.  The code comments explains what you need to know about PySide and dbus, any doubts, see the python-dbus help.

DBUS Client
-----------

.. literalinclude:: codesnippets/examples/dbus/example-client.py


DBUS Server
-----------

.. literalinclude:: codesnippets/examples/dbus/example-server.py


Running the example
-------------------

Copy the client code to a file called ``example-client.py`` and the server to a file called ``example-server.py`` and type:

::

    $ python example-server.py &
    $ python example-client.py

A litle window should appear on screen. Click on the button to emit a Qt signal, this signal will be converted to a DBus signal that will be caught by our dbus client. That's all.