Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgenericunixtheme_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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// Qt-Security score:significant reason:default
4
5#ifndef QGENERICUNIXTHEME_H
6#define QGENERICUNIXTHEME_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <qpa/qplatformtheme.h>
20#include <qpa/qplatformtheme_p.h>
21#include <QtCore/QString>
22#include <QtCore/QStringList>
23#include <QtGui/QFont>
24#include <QtCore/private/qglobal_p.h>
25
26QT_BEGIN_NAMESPACE
27
28class QGenericUnixTheme;
36
37class Q_GUI_EXPORT QGenericUnixTheme : public QPlatformTheme
38{
39 Q_DECLARE_PRIVATE(QGenericUnixTheme)
40
41protected:
42 QGenericUnixTheme(QGenericUnixThemePrivate *p);
43
44public:
45 QGenericUnixTheme();
46
47 const QFont *font(Font type) const override;
48 QVariant themeHint(ThemeHint hint) const override;
49
50#if QT_CONFIG(dbus)
51 QPlatformMenuBar *createPlatformMenuBar() const override;
52#endif
53#if QT_CONFIG(dbus) && QT_CONFIG(systemtrayicon)
54 QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override;
55#endif
56
57 static const char *name;
58
59 // Default system font, corresponding to the value returned by 4.8 for
60 // XRender/FontConfig which we can now assume as default.
61 static constexpr char defaultSystemFontNameC[] = "Sans Serif";
62 static constexpr char defaultFixedFontNameC[] = "monospace";
63 enum { defaultSystemFontSize = 9 };
64
65 // Helpers
66 static QStringList xdgIconThemePaths();
67 static QPlatformTheme *createUnixTheme(const QString &name);
68 static QStringList themeNames();
69protected:
70 static QStringList iconFallbackPaths();
71 static bool isDBusGlobalMenuAvailable();
72 static QString mouseCursorTheme();
73 static QSize mouseCursorSize();
74 static QList<QSize> availableXdgFileIconSizes();
75
76#if QT_CONFIG(dbus) && QT_CONFIG(systemtrayicon)
77 static bool shouldUseDBusTray();
78#endif
79#if QT_CONFIG(mimetype)
80 static QIcon xdgFileIcon(const QFileInfo &fileInfo);
81#endif
82};
83
84QT_END_NAMESPACE
85
86#endif // QGENERICUNIXTHEME_H
Combined button and popup list for selecting options.