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 "qquickmaterialstyle_p.h" |
5 | #include "qquickmaterialtheme_p.h" |
6 | |
7 | #include <QtQuickControls2/private/qquickstyleplugin_p.h> |
8 | #include <QtQuickControls2Impl/private/qquickpaddedrectangle_p.h> |
9 | #include <QtQuickTemplates2/private/qquicktheme_p.h> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | extern void qml_register_types_QtQuick_Controls_Material(); |
14 | Q_GHS_KEEP_REFERENCE(qml_register_types_QtQuick_Controls_Material); |
15 | |
16 | class QtQuickControls2MaterialStylePlugin : public QQuickStylePlugin |
17 | { |
18 | Q_OBJECT |
19 | Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) |
20 | |
21 | public: |
22 | QtQuickControls2MaterialStylePlugin(QObject *parent = nullptr); |
23 | |
24 | QString name() const override; |
25 | void initializeTheme(QQuickTheme *theme) override; |
26 | |
27 | QQuickMaterialTheme theme; |
28 | }; |
29 | |
30 | QtQuickControls2MaterialStylePlugin::QtQuickControls2MaterialStylePlugin(QObject *parent) : QQuickStylePlugin(parent) |
31 | { |
32 | volatile auto registration = &qml_register_types_QtQuick_Controls_Material; |
33 | Q_UNUSED(registration); |
34 | } |
35 | |
36 | QString QtQuickControls2MaterialStylePlugin::name() const |
37 | { |
38 | return QStringLiteral("Material"); |
39 | } |
40 | |
41 | void QtQuickControls2MaterialStylePlugin::initializeTheme(QQuickTheme *theme) |
42 | { |
43 | QQuickMaterialStyle::initGlobals(); |
44 | this->theme.initialize(theme); |
45 | } |
46 | |
47 | QT_END_NAMESPACE |
48 | |
49 | #include "qtquickcontrols2materialstyleplugin.moc" |
50 |