Qt 6.x
The Qt SDK
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
50 enum ThemeHint {
100 };
101 Q_ENUM(ThemeHint)
102
108 };
110
111 enum Palette {
122 MessageBoxLabelPalette = MessageBoxLabelPelette,
130 NPalettes
131 };
132 Q_ENUM(Palette)
133
134 enum Font {
162 NFonts
163 };
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
254 {
260 CdeKeyboardScheme
261 };
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
299 virtual const QPalette *palette(Palette type = SystemPalette) const;
300
301 virtual const QFont *font(Font type = SystemFont) const;
302
303 virtual QVariant themeHint(ThemeHint hint) const;
304
305 virtual QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const;
306 virtual QIcon fileIcon(const QFileInfo &fileInfo,
307 QPlatformTheme::IconOptions iconOptions = { }) const;
308 virtual QIconEngine *createIconEngine(const QString &iconName) const;
309
310#if QT_CONFIG(shortcut)
311 virtual QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const;
312#endif
313
314 virtual QString standardButtonText(int button) const;
315#if QT_CONFIG(shortcut)
316 virtual QKeySequence standardButtonShortcut(int button) const;
317#endif
318
319 static QVariant defaultThemeHint(ThemeHint hint);
320 static QString defaultStandardButtonText(int button);
321 static QString removeMnemonics(const QString &original);
322 QString name() const;
323
324protected:
327
328private:
330};
331
333
334#endif // QPLATFORMTHEME_H
\inmodule QtCore \reentrant
Definition qfileinfo.h:22
\reentrant
Definition qfont.h:20
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.
Definition qlist.h:74
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
\inmodule QtCore
Definition qsize.h:207
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qvariant.h:64
QPushButton * button
[2]
Combined button and popup list for selecting options.
ColorScheme
Definition qnamespace.h:49
#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