summaryrefslogtreecommitdiffstats
path: root/doc/src/frameworks-technologies/dbus-adaptors.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/frameworks-technologies/dbus-adaptors.qdoc')
-rw-r--r--doc/src/frameworks-technologies/dbus-adaptors.qdoc26
1 files changed, 13 insertions, 13 deletions
diff --git a/doc/src/frameworks-technologies/dbus-adaptors.qdoc b/doc/src/frameworks-technologies/dbus-adaptors.qdoc
index 7494f2d..82545db 100644
--- a/doc/src/frameworks-technologies/dbus-adaptors.qdoc
+++ b/doc/src/frameworks-technologies/dbus-adaptors.qdoc
@@ -85,14 +85,14 @@
using an adaptor.
A sample usage of QDBusAbstractAdaptor is as follows:
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 0
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 0
The code above would create an interface that could be represented more or less in the following
canonical representation:
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 1
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 1
This adaptor could be used in the application's main function as follows
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 2
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 2
Break-down analysis:
\tableofcontents
@@ -100,7 +100,7 @@
\section1 The header
The header of the example is:
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 3
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 3
The code does the following:
\list
@@ -112,10 +112,10 @@
\section1 The properties
The properties are declared as follows:
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 4
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 4
And are implemented as follows:
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 5
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 5
The code declares three properties: one of them is a read-write property called "caption" of
string type. The other two are read-only, also of the string type.
@@ -129,7 +129,7 @@
\section1 The constructor
The constructor:
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 6
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 6
The constructor does the following:
\list
@@ -149,7 +149,7 @@
\section1 Slots/methods
The public slots in the example (which will be exported as D-Bus methods) are the following:
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 7
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 7
This snippet of code defines 4 methods with different properties each:
\list 1
@@ -176,7 +176,7 @@
\section1 Signals
The signals in this example are defined as follows:
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 8
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 8
However, signal definition isn't enough: signals have to be emitted. One simple way of emitting
signals is to connect another signal to them, so that Qt's signal handling system chains them
@@ -187,7 +187,7 @@
When simple signal-to-signal connection isn't enough, one can use a private slot do do some
work. This is what was done for the mainWindowHasFocus signal:
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 9
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 9
This private slot (which will not be exported as a method via D-Bus) was connected to the
\c focusChanged signal in the adaptor's constructor. It is therefore able to shape the
@@ -291,7 +291,7 @@
\l{QDBusMessage::setDelayedReply()}{QDBusMessage::setDelayedReply(true)}
that the response will be sent later.
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 10
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 10
The use of
\l{QDBusConnection::send()}{QDBusConnection::sessionBus().send(data->reply)}
@@ -303,7 +303,7 @@
using the \c QDBusMessage object that was obtained. In our example, the
reply code could be something as follows:
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 11
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 11
As can be seen in the example, when a delayed reply is in place,
the return value(s) from the slot will be ignored by QtDBus. They
@@ -473,7 +473,7 @@
You can use this macro in your own adaptors by placing it before your method's return value
(which must be "void") in the class declaration, as shown in the example:
- \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 12
+ \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 12
Its presence in the method implementation (outside the class declaration) is optional.