diff options
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/examples/bluetoothtransferplugin.qdoc | 13 | ||||
| -rw-r--r-- | doc/src/examples/filemanagerplugin.qdoc | 18 | ||||
| -rw-r--r-- | doc/src/si.qdoc | 10 |
3 files changed, 34 insertions, 7 deletions
diff --git a/doc/src/examples/bluetoothtransferplugin.qdoc b/doc/src/examples/bluetoothtransferplugin.qdoc index d150ba3b35..6322fcbbe8 100644 --- a/doc/src/examples/bluetoothtransferplugin.qdoc +++ b/doc/src/examples/bluetoothtransferplugin.qdoc @@ -44,4 +44,17 @@ \title Bluetooth Transfer Plugin Example This example shows how to write a service plugin for the \l{Qt Service Framework}{Service Framework}. + + \section1 Registering the Service + The service can be registered by using the function \l{QServiceManager::}{addService()}, this takes a path to the XML file that describes the service, \i{bluetoothtransferservice.xml}. + + \section1 Writing the Plugin + To implement a plugin it is necessary to create a new plugin class derived from QObject and QServicePluginInterface. The function QServicePluginInterface::createInstance() is implemented to return the appropriate instantiated object based on the interface name passed into the function. Since there is only one interface name for this example there is no test involved, so we can simply create the object implementing the service and return its pointer. + + \snippet snippets/service-snippets/bluetoothtransferplugin.cpp createinstance + + The implementation of the service BluetoothTransfer is simply a test function for this example. The BluetoothTransfer class is very simple, with only an empty constructor and the sendFile() function + + \snippet snippets/service-snippets/bluetoothtransfer.cpp sendFile + */ diff --git a/doc/src/examples/filemanagerplugin.qdoc b/doc/src/examples/filemanagerplugin.qdoc index bf8b621dc8..3ee6ecff46 100644 --- a/doc/src/examples/filemanagerplugin.qdoc +++ b/doc/src/examples/filemanagerplugin.qdoc @@ -44,4 +44,22 @@ \title File Manager Plugin Example This example shows how to write a service plugin for the \l{Qt Service Framework}{Service Framework}. + + \section1 Registering the Service + The service can be registered by using the function \l{QServiceManager::}{addService()} which takes a path to the XML file that describes the service, \i{filemanagerservice.xml}. + + \section1 Writing the Plug-In + A Service plug-in is made by deriving a new plugin class from the QServicePluginInterface class then implementing the function QServicePluginInterface::createInstance(). + + The FileManager plugin example has a simple \l {QServicePluginInterface::}{createInstance()}. It + only needs to create the appropriate object based on the interface name + and return a pointer to it. + + \snippet snippets/service-snippets/filemanagerplugin.cpp createinstance + + The functionality of the FileManager and the FileTransfer classes are + in the separate classes FileManagerStorage and FileManagerTransfer respectively. The existing functions are merely test stubs to demonstrate + the concept. + + */ diff --git a/doc/src/si.qdoc b/doc/src/si.qdoc index edd736627e..ece40e753c 100644 --- a/doc/src/si.qdoc +++ b/doc/src/si.qdoc @@ -132,14 +132,10 @@ If the NetworkManager backend is required run qmake as follows: The backend selection is expected to disappear once the API is integrated into Qt. -\section1 Reference documentation +\section1 Examples -\section2 Examples +\section2 System Information Example -\list - \o \l{File Manager Plugin Example} - \o \l{Bluetooth Transfer Plugin Example} - \o \l{Service Browser Example} -\endlist +The \l{sysinfo}{System Information} example demonstrates how an application can very easily access the system information of the device. */ |
