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
qcocoatheme.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QPLATFORMTHEME_COCOA_H
6#define QPLATFORMTHEME_COCOA_H
7
8#include <QtCore/QHash>
9#include <qpa/qplatformtheme.h>
10
11#include <QtCore/private/qcore_mac_p.h>
12
13QT_BEGIN_NAMESPACE
14
15class QPalette;
17{
18public:
20 ~QCocoaTheme();
21
22 void reset();
23
25 QPlatformMenu* createPlatformMenu() const override;
26 QPlatformMenuBar* createPlatformMenuBar() const override;
27
28#ifndef QT_NO_SYSTEMTRAYICON
30#endif
31
32 bool usePlatformNativeDialog(DialogType dialogType) const override;
33 QPlatformDialogHelper *createPlatformDialogHelper(DialogType dialogType) const override;
34
35 const QPalette *palette(Palette type = SystemPalette) const override;
36 const QFont *font(Font type = SystemFont) const override;
37 QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override;
38 QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions options = {}) const override;
39 QIconEngine *createIconEngine(const QString &iconName) const override;
40
41 QVariant themeHint(ThemeHint hint) const override;
42 Qt::ColorScheme colorScheme() const override;
44 QString standardButtonText(int button) const override;
45 QKeySequence standardButtonShortcut(int button) const override;
46
47 static const char *name;
48
49 void requestColorScheme(Qt::ColorScheme scheme) override;
51
52#ifndef QT_NO_SHORTCUT
53 QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const override;
54#endif
55
56private:
57 mutable QPalette *m_systemPalette;
58 QMacNotificationObserver m_systemColorObserver;
59 mutable QHash<QPlatformTheme::Palette, QPalette*> m_palettes;
60 QMacKeyValueObserver m_appearanceObserver;
61
62 Qt::ColorScheme m_colorScheme = Qt::ColorScheme::Unknown;
63 void updateColorScheme();
64};
65
66QT_END_NAMESPACE
67
68#endif
QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions options={}) const override
Return an icon for fileInfo, observing iconOptions.
Qt::ColorScheme colorScheme() const override
QString standardButtonText(int button) const override
Returns the text of a standard button.
QPlatformDialogHelper * createPlatformDialogHelper(DialogType dialogType) const override
QPlatformMenu * createPlatformMenu() const override
Qt::ContrastPreference contrastPreference() const override
static const char * name
Definition qcocoatheme.h:47
void handleSystemThemeChange()
QIconEngine * createIconEngine(const QString &iconName) const override
Factory function for the QIconEngine used by QIcon::fromTheme().
QPlatformMenuBar * createPlatformMenuBar() const override
QList< QKeySequence > keyBindings(QKeySequence::StandardKey key) const override
const QPalette * palette(Palette type=SystemPalette) const override
Return a color palette for type type.
bool usePlatformNativeDialog(DialogType dialogType) const override
QKeySequence standardButtonShortcut(int button) const override
QPlatformSystemTrayIcon * createPlatformSystemTrayIcon() const override
Factory function for QSystemTrayIcon.
QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override
Return a pixmap for standardPixmap, at the given size.
void requestColorScheme(Qt::ColorScheme scheme) override
QVariant themeHint(ThemeHint hint) const override
const QFont * font(Font type=SystemFont) const override
QPlatformMenuItem * createPlatformMenuItem() const override
friend class QFontEngineFT
Definition qpainter.h:434
static QCocoaIntegration::Options parseOptions(const QStringList &paramList)
static void initResources()
static void logVersionInformation()
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")