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
qtquickcontrols2macosstyleplugin.cpp
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#include <QtQml/qqml.h>
6#include <QtQuickControls2/private/qquickstyleplugin_p.h>
7#include <QtQuickControls2/qquickstyle.h>
8#include <private/qquicktheme_p.h>
9
11
14
16{
17 Q_OBJECT
18 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
19
20public:
22 QString name() const override;
23 void initializeTheme(QQuickTheme *theme) override;
24};
25
26
27QtQuickControls2MacOSStylePlugin::QtQuickControls2MacOSStylePlugin(QObject *parent):
28 QQuickStylePlugin(parent)
29{
30 volatile auto registration = &qml_register_types_QtQuick_Controls_macOS;
31 Q_UNUSED(registration);
32}
33
35{
36 return QStringLiteral("macOS");
37}
38
40{
41 Q_ASSERT(theme);
42 theme->setUsePlatformPalette(true);
43}
44
45QT_END_NAMESPACE
46
47#include "qtquickcontrols2macosstyleplugin.moc"
void initializeTheme(QQuickTheme *theme) override
Q_GHS_KEEP_REFERENCE(qml_register_types_QtQuick_Controls_macOS)
QT_BEGIN_NAMESPACE void qml_register_types_QtQuick_Controls_macOS()