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