1 /****************************************************************************
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
6 ** This file is part of the documentation of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:FDL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** information use the contact form at http://www.qt.io/contact-us.
17 ** GNU Free Documentation License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Free
19 ** Documentation License version 1.3 as published by the Free Software
20 ** Foundation and appearing in the file included in the packaging of
21 ** this file. Please review the following information to ensure
22 ** the GNU Free Documentation License version 1.3 requirements
23 ** will be met: http://www.gnu.org/copyleft/fdl.html.
26 ****************************************************************************/
29 \page desktop-integration.html
30 \title Desktop Integration
31 \brief Integrating with the user's desktop environment.
33 \ingroup best-practices
34 \ingroup qt-gui-concepts
36 Qt applications behave well in the user's desktop environment, but certain
37 integrations require additional, and sometimes platform specific, techniques.
41 \section1 Useful Classes
43 Various classes in Qt are designed to help developers integrate applications into
44 users' desktop environments. These classes enable developers to take advantage
45 of native services while still using a cross-platform API.
47 \annotatedlist desktop
49 \section1 Setting the Application Icon
51 In order to change the icon of the executable application file
52 itself, as it is presented on the desktop (i.e., prior to
53 application execution), it is necessary to employ another,
54 platform-dependent technique.
56 \tableofcontents {1 Setting the Application Icon}
58 \section1 Opening External Resources
60 Although Qt provides facilities to handle and display resources, such as
61 \l{QImageIOHandler}{common image formats} and \l{QTextDocument}{HTML},
62 it is sometimes necessary to open files and external resources using external
65 QDesktopServices provides an interface to services offered by the user's desktop
66 environment. In particular, the \l{QDesktopServices::}{openUrl()} function is
67 used to open resources using the appropriate application, which may have been
68 specifically configured by the user.
70 \section1 System Tray Icons
72 Many modern desktop environments feature docks or panels with \e{system trays}
73 in which applications can install icons. Applications often use system tray icons
74 to display status information, either by updating the icon itself or by showing
75 information in "balloon messages". Additionally, many applications provide
76 pop-up menus that can be accessed via their system tray icons.
78 The QSystemTrayIcon class exposes all of the above features via an intuitive
79 Qt-style API that can be used on all desktop platforms.
81 \section1 Desktop Widgets
83 On systems where the user's desktop is displayed using more than one screen,
84 certain types of applications may need to obtain information about the
85 configuration of the user's workspace to ensure that new windows and dialogs
86 are opened in appropriate locations.
88 The QDesktopWidget class can be used to monitor the positions of widgets and
89 notify applications about changes to the way the desktop is split over the
90 available screens. This enables applications to implement policies for
91 positioning new windows so that, for example, they do not distract a user
92 who is working on a specific task.