Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qplatformtheme.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
4#ifndef QPLATFORMTHEME_H
5#define QPLATFORMTHEME_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is part of the QPA API and is not meant to be used
12// in applications. Usage of this API may make your code
13// source and binary incompatible with future versions of Qt.
14//
15
16#include <QtGui/qtguiglobal.h>
17#include <QtCore/QObject>
18#include <QtCore/QScopedPointer>
19#if QT_CONFIG(shortcut)
20# include <QtGui/QKeySequence>
21#endif
22
24
25class QIcon;
26class QIconEngine;
27class QMenu;
28class QMenuBar;
30class QPlatformMenu;
35class QVariant;
36class QPalette;
37class QFont;
38class QPixmap;
39class QSizeF;
40class QFileInfo;
41
42class Q_GUI_EXPORT QPlatformTheme
43{
45 Q_DECLARE_PRIVATE(QPlatformTheme)
46
47public:
48 Q_DISABLE_COPY_MOVE(QPlatformTheme)
49
101 Q_ENUM(ThemeHint)
102
110
132 Q_ENUM(Palette)
133
164 Q_ENUM(Font)
165
166 enum StandardPixmap { // Keep in sync with QStyle::StandardPixmap
246 NStandardPixmap, // assertion value for sync with QStyle::StandardPixmap
247
248 // do not add any values below/greater than this
249 CustomBase = 0xf0000000
250 };
251 Q_ENUM(StandardPixmap)
252
262 Q_ENUM(KeyboardSchemes)
263
265 {
266 GeneralUiEffect = 0x1,
267 AnimateMenuUiEffect = 0x2,
268 FadeMenuUiEffect = 0x4,
269 AnimateComboUiEffect = 0x8,
270 AnimateTooltipUiEffect = 0x10,
271 FadeTooltipUiEffect = 0x20,
272 AnimateToolBoxUiEffect = 0x40,
273 HoverEffect = 0x80
274 };
275 Q_ENUM(UiEffect)
276
278 DontUseCustomDirectoryIcons = 0x01
279 };
280 Q_DECLARE_FLAGS(IconOptions, IconOption)
281
282 explicit QPlatformTheme();
283 virtual ~QPlatformTheme();
284
285 virtual QPlatformMenuItem* createPlatformMenuItem() const;
286 virtual QPlatformMenu* createPlatformMenu() const;
287 virtual QPlatformMenuBar* createPlatformMenuBar() const;
288 virtual void showPlatformMenuBar() {}
289
290 virtual bool usePlatformNativeDialog(DialogType type) const;
291 virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const;
292
293#ifndef QT_NO_SYSTEMTRAYICON
294 virtual QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const;
295#endif
296
297 virtual Qt::ColorScheme colorScheme() const;
298 virtual void requestColorScheme(Qt::ColorScheme scheme);
299
300 virtual const QPalette *palette(Palette type = SystemPalette) const;
301
302 virtual const QFont *font(Font type = SystemFont) const;
303
304 virtual QVariant themeHint(ThemeHint hint) const;
305
306 virtual QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const;
307 virtual QIcon fileIcon(const QFileInfo &fileInfo,
308 QPlatformTheme::IconOptions iconOptions = { }) const;
309 virtual QIconEngine *createIconEngine(const QString &iconName) const;
310
311#if QT_CONFIG(shortcut)
312 virtual QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const;
313#endif
314
315 virtual QString standardButtonText(int button) const;
316#if QT_CONFIG(shortcut)
317 virtual QKeySequence standardButtonShortcut(int button) const;
318#endif
319
320 static QVariant defaultThemeHint(ThemeHint hint);
321 static QString defaultStandardButtonText(int button);
322 static QString removeMnemonics(const QString &original);
323 QString name() const;
324
325protected:
327 QScopedPointer<QPlatformThemePrivate> d_ptr;
328
329private:
331};
332
334
335#endif // QPLATFORMTHEME_H
\reentrant
Definition qfont.h:22
The QIconEngine class provides an abstract base class for QIcon renderers.
Definition qiconengine.h:15
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
The QKeySequence class encapsulates a key sequence as used by shortcuts.
The QMenuBar class provides a horizontal menu bar.
Definition qmenubar.h:20
The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
Definition qmenu.h:26
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
The QPlatformDialogHelper class allows for platform-specific customization of dialogs.
The QPlatformTheme class allows customizing the UI based on themes.
virtual void showPlatformMenuBar()
Q_ENUM(DialogType)
ThemeHint
This enum describes the available theme hints.
@ DialogButtonBoxButtonsHaveIcons
@ ItemViewActivateItemOnSingleClick
QScopedPointer< QPlatformThemePrivate > d_ptr
\inmodule QtCore
Definition qsize.h:208
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
QPushButton * button
[2]
Combined button and popup list for selecting options.
ColorScheme
Definition qnamespace.h:50
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
static const QMetaObjectPrivate * priv(const uint *data)
GLuint64 key
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum type
GLuint name
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define sp
#define Q_ENUM(x)
#define Q_GADGET