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
main.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 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 <QtWidgets/private/qtwidgetsglobal_p.h>
5#include <QtWidgets/qstyleplugin.h>
6#include <QtCore/qoperatingsystemversion.h>
8#include "qwindows11style_p.h"
9
11
13{
15 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "modernwindowsstyles.json")
16public:
17 QStyle *create(const QString &key) override;
18};
19
21{
23 if (isWin11OrAbove && key.compare(QLatin1String("windows11"), Qt::CaseInsensitive) == 0) {
24 return new QWindows11Style();
25 } else if (!isWin11OrAbove && key.compare(QLatin1String("windows11"), Qt::CaseInsensitive) == 0) {
26 qWarning("QWindows11Style: Style is only supported on Windows11 and above");
27 return new QWindowsVistaStyle();
28 } else if (key.compare(QLatin1String("windowsvista"), Qt::CaseInsensitive) == 0) {
29 return new QWindowsVistaStyle();
30 }
31 return nullptr;
32}
33
35
36#include "main.moc"
QStyle * create(const QString &key) override
Creates and returns a QStyle object for the given style key.
Definition main.cpp:20
static Q_CORE_EXPORT QOperatingSystemVersionBase current()
static constexpr QOperatingSystemVersionBase Windows11
\variable QOperatingSystemVersion::Windows11
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QStylePlugin class provides an abstract base for custom QStyle plugins.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
Definition qstyle.h:29
The QWindows11Style class provides a look and feel suitable for applications on Microsoft Windows 11.
The QWindowsVistaStyle class provides a look and feel suitable for applications on Microsoft Windows ...
Combined button and popup list for selecting options.
@ CaseInsensitive
#define qWarning
Definition qlogging.h:166
GLuint64 key
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)
view create()