summaryrefslogtreecommitdiffstats
path: root/qtservice/examples/interactive/interactive.qdoc
blob: b4ee21f9ce75c382bd5bdb1fec19400dae1903eb (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
31
32
33
// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
// SPDX-License-Identifier: BSD-3-Clause

/*! \page qtservice-example-interactive.html
    \title An Interactive Service

    This example implements a service with a simple user interface.

    Services are usually non-interactive console applications. User
    interaction, if required, is usually implemented in a separate,
    normal GUI application that communicates with the service through
    an IPC channel. For simple communication,
    QtServiceController::sendCommand() and QtService::processCommand()
    may be used, possibly in combination with a shared settings
    file. For more complex, interactive communication, a custom IPC
    channel should be used, e.g. based on Qt's networking classes.

    However, although not recommended in the general case, in certain
    circumstances a service may provide a GUI
    itself. This is typically only possible if the service process is run as
    the same user as the one that is logged in, so that it will have
    access to the screen. Note however that on Windows Vista, service
    GUIs are not allowed at all, since services run in a
    diferent session than all user sessions, for security reasons.

    This example demonstrates how to subclass the QtService class, the use of
    start(), stop(), pause(), resume(), and how to use
    processCommand() to receive control commands while running.

    Here is the complete source code:

    \quotefile interactive/main.cpp
*/