From ddf2e2367ccf651fc25f02a3e7975a8b57a4bc98 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 21 Mar 2014 10:02:07 +0100 Subject: [PATCH] Doc: Move IPC example documentation Examples under examples/ipc were not part of any module documentation. This change adds the above folder to Qt Core documentation, and moves the corresponding files so that the example documentation is built correctly. Change-Id: If1f34ce7ef04a02df8a87f820bb2e68ffa723dd4 Reviewed-by: Friedemann Kleint Reviewed-by: Jerome Pasion --- .../doc}/images/localfortuneclient-example.png | Bin .../doc}/images/localfortuneserver-example.png | Bin .../ipc/doc}/images/sharedmemory-example_1.png | Bin .../ipc/doc}/images/sharedmemory-example_2.png | Bin .../ipc/doc/src}/localfortuneclient.qdoc | 4 ++-- .../ipc/doc/src}/localfortuneserver.qdoc | 4 ++-- .../ipc/doc/src}/sharedmemory.qdoc | 14 +++++++------- src/corelib/doc/qtcore.qdocconf | 1 + 8 files changed, 12 insertions(+), 11 deletions(-) rename {doc/src => examples/ipc/doc}/images/localfortuneclient-example.png (100%) rename {doc/src => examples/ipc/doc}/images/localfortuneserver-example.png (100%) rename {doc/src => examples/ipc/doc}/images/sharedmemory-example_1.png (100%) rename {doc/src => examples/ipc/doc}/images/sharedmemory-example_2.png (100%) rename {doc/src/examples => examples/ipc/doc/src}/localfortuneclient.qdoc (94%) rename {doc/src/examples => examples/ipc/doc/src}/localfortuneserver.qdoc (94%) rename {doc/src/examples => examples/ipc/doc/src}/sharedmemory.qdoc (94%) diff --git a/doc/src/images/localfortuneclient-example.png b/examples/ipc/doc/images/localfortuneclient-example.png similarity index 100% rename from doc/src/images/localfortuneclient-example.png rename to examples/ipc/doc/images/localfortuneclient-example.png diff --git a/doc/src/images/localfortuneserver-example.png b/examples/ipc/doc/images/localfortuneserver-example.png similarity index 100% rename from doc/src/images/localfortuneserver-example.png rename to examples/ipc/doc/images/localfortuneserver-example.png diff --git a/doc/src/images/sharedmemory-example_1.png b/examples/ipc/doc/images/sharedmemory-example_1.png similarity index 100% rename from doc/src/images/sharedmemory-example_1.png rename to examples/ipc/doc/images/sharedmemory-example_1.png diff --git a/doc/src/images/sharedmemory-example_2.png b/examples/ipc/doc/images/sharedmemory-example_2.png similarity index 100% rename from doc/src/images/sharedmemory-example_2.png rename to examples/ipc/doc/images/sharedmemory-example_2.png diff --git a/doc/src/examples/localfortuneclient.qdoc b/examples/ipc/doc/src/localfortuneclient.qdoc similarity index 94% rename from doc/src/examples/localfortuneclient.qdoc rename to examples/ipc/doc/src/localfortuneclient.qdoc index ec1306b10a..a68f4bad0c 100644 --- a/doc/src/examples/localfortuneclient.qdoc +++ b/examples/ipc/doc/src/localfortuneclient.qdoc @@ -26,14 +26,14 @@ ****************************************************************************/ /*! - \example ipc/localfortuneclient + \example localfortuneclient \title Local Fortune Client Example \ingroup examples-ipc \brief Demonstrates using QLocalSocket for a simple local service client. The Local Fortune Client example shows how to create a client for a simple local service using QLocalSocket. It is intended to be run alongside the - \l{ipc/localfortuneserver}{Local Fortune Server} example. + \l{Local Fortune Server Example}. \image localfortuneclient-example.png Screenshot of the Local Fortune Client example diff --git a/doc/src/examples/localfortuneserver.qdoc b/examples/ipc/doc/src/localfortuneserver.qdoc similarity index 94% rename from doc/src/examples/localfortuneserver.qdoc rename to examples/ipc/doc/src/localfortuneserver.qdoc index d9828d4145..13f7f3ca74 100644 --- a/doc/src/examples/localfortuneserver.qdoc +++ b/examples/ipc/doc/src/localfortuneserver.qdoc @@ -26,14 +26,14 @@ ****************************************************************************/ /*! - \example ipc/localfortuneserver + \example localfortuneserver \title Local Fortune Server Example \ingroup examples-ipc \brief Demonstrates using QLocalServer and QLocalSocket for serving a simple local service. The Local Fortune Server example shows how to create a server for a simple local service. It is intended to be run alongside the - \l{ipc/localfortuneclient}{Local Fortune Client} example + \l{Local Fortune Client Example} \image localfortuneserver-example.png Screenshot of the Local Fortune Server example */ diff --git a/doc/src/examples/sharedmemory.qdoc b/examples/ipc/doc/src/sharedmemory.qdoc similarity index 94% rename from doc/src/examples/sharedmemory.qdoc rename to examples/ipc/doc/src/sharedmemory.qdoc index e8c3f00f26..b9f0c86d44 100644 --- a/doc/src/examples/sharedmemory.qdoc +++ b/examples/ipc/doc/src/sharedmemory.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example ipc/sharedmemory + \example sharedmemory \title Shared Memory Example \ingroup examples-ipc \brief Demonstrates doing inter-process communication using shared memory with @@ -40,7 +40,7 @@ dialog is displayed and then control is passed to the application in the standard way. - \snippet examples/ipc/sharedmemory/main.cpp 0 + \snippet sharedmemory/main.cpp 0 Two instances of class Dialog appear. @@ -51,12 +51,12 @@ loadFromFile() and loadFromMemory() that correspond to the two buttons on the dialog. - \snippet examples/ipc/sharedmemory/dialog.h 0 + \snippet sharedmemory/dialog.h 0 The constructor builds the user interface widgets and connects the clicked() signal of each button to the corresponding slot function. - \snippet examples/ipc/sharedmemory/dialog.cpp 0 + \snippet sharedmemory/dialog.cpp 0 Note that "QSharedMemoryExample" is passed to the \l {QSharedMemory} {QSharedMemory()} constructor to be used as the key. This will be @@ -69,7 +69,7 @@ that segment is detached from the process, so we can be assured of starting off the example correctly. - \snippet examples/ipc/sharedmemory/dialog.cpp 1 + \snippet sharedmemory/dialog.cpp 1 The user is then asked to select an image file using QFileDialog::getOpenFileName(). The selected file is loaded into a @@ -85,7 +85,7 @@ to the image data, which we then use to do a memcopy() from the QBuffer into the shared memory segment. - \snippet examples/ipc/sharedmemory/dialog.cpp 2 + \snippet sharedmemory/dialog.cpp 2 Note that we \l {QSharedMemory::} {lock()} the shared memory segment before we copy into it, and we \l {QSharedMemory::} {unlock()} it @@ -117,7 +117,7 @@ then streams the data into a QImage and \l {QSharedMemory::unlock()} {unlocks} the segment. - \snippet examples/ipc/sharedmemory/dialog.cpp 3 + \snippet sharedmemory/dialog.cpp 3 In this case, the function does \l {QSharedMemory::} {detach()} from the segment, because now we are effectively finished using diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index 2ad24d33b1..18342d0138 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -37,6 +37,7 @@ exampledirs += \ snippets \ ../../../examples/threads/ \ ../../../examples/tools/ \ + ../../../examples/ipc/ \ ../../../examples/json/ \ ../../../examples/network/dnslookup