1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qplatformservices.h"
5
6#include <QtCore/QUrl>
7#include <QtCore/QString>
8#include <QtCore/QDebug>
9
10QT_BEGIN_NAMESPACE
11
12/*!
13 \class QPlatformServices
14 \since 5.0
15 \internal
16 \preliminary
17 \ingroup qpa
18
19 \brief The QPlatformServices provides the backend for desktop-related functionality.
20*/
21
22/*!
23 \enum QPlatformServices::Capability
24
25 Capabilities are used to determine a specific platform service's availability.
26
27 \value ColorPickingFromScreen The platform natively supports color picking from screen.
28 This capability indicates that the platform supports "opaque" color picking, where the
29 platform implements a complete user experience for color picking and outputs a color.
30 This is in contrast to the application implementing the color picking user experience
31 (taking care of showing a cross hair, instructing the platform integration to obtain
32 the color at a given pixel, etc.). The related service function is pickColor().
33 */
34
35QPlatformServices::QPlatformServices()
36{ }
37
38bool QPlatformServices::openUrl(const QUrl &url)
39{
40 qWarning(msg: "This plugin does not support QPlatformServices::openUrl() for '%s'.",
41 qPrintable(url.toString()));
42 return false;
43}
44
45bool QPlatformServices::openDocument(const QUrl &url)
46{
47 qWarning(msg: "This plugin does not support QPlatformServices::openDocument() for '%s'.",
48 qPrintable(url.toString()));
49 return false;
50}
51
52/*!
53 * \brief QPlatformServices::desktopEnvironment returns the active desktop environment.
54 *
55 * On Unix this function returns the uppercase desktop environment name, such as
56 * KDE, GNOME, UNITY, XFCE, LXDE etc. or UNKNOWN if none was detected.
57 * The primary way to detect the desktop environment is the environment variable
58 * XDG_CURRENT_DESKTOP.
59 */
60QByteArray QPlatformServices::desktopEnvironment() const
61{
62 return QByteArray("UNKNOWN");
63}
64
65QPlatformServiceColorPicker *QPlatformServices::colorPicker(QWindow *parent)
66{
67 Q_UNUSED(parent);
68 return nullptr;
69}
70
71bool QPlatformServices::hasCapability(Capability capability) const
72{
73 Q_UNUSED(capability)
74 return false;
75}
76
77QT_END_NAMESPACE
78

source code of qtbase/src/gui/kernel/qplatformservices.cpp