1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Quick Extras module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#include "flatstyleplugin.h"
41
42#include <QtCore/qglobal.h>
43#include <QtCore/qfile.h>
44#include <QtCore/qdebug.h>
45
46#include "qquicktexthandle.h"
47
48#ifndef QT_STATIC
49extern "C" {
50 Q_DECL_EXPORT bool qt_quick_controls_style_init()
51 {
52 return true;
53 }
54
55 Q_DECL_EXPORT const char* qt_quick_controls_style_path()
56 {
57 return ":/ExtrasImports/QtQuick/Controls/Styles/Flat";
58 }
59}
60#endif
61
62QT_BEGIN_NAMESPACE
63
64QtQuickExtrasStylesPlugin::QtQuickExtrasStylesPlugin(QObject *parent) :
65 QQmlExtensionPlugin(parent)
66{
67}
68
69void QtQuickExtrasStylesPlugin::registerTypes(const char *uri)
70{
71#ifndef QT_STATIC
72 const QString prefix = "qrc:///ExtrasImports/QtQuick/Controls/Styles/Flat/";
73#else
74 const QString prefix = "qrc:/qt-project.org/imports/QtQuick/Controls/Styles/Flat/";
75#endif
76 // register version 1.0
77 qmlRegisterSingletonType(url: QUrl(prefix + "FlatStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "FlatStyle");
78 qmlRegisterType(url: QUrl(prefix + "ApplicationWindowStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "ApplicationWindowStyle");
79 qmlRegisterType(url: QUrl(prefix + "BusyIndicatorStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "BusyIndicatorStyle");
80 qmlRegisterType(url: QUrl(prefix + "ButtonStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "ButtonStyle");
81 qmlRegisterType(url: QUrl(prefix + "CalendarStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "CalendarStyle");
82 qmlRegisterType(url: QUrl(prefix + "CheckBoxStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "CheckBoxStyle");
83 qmlRegisterType(url: QUrl(prefix + "CheckBoxDrawer.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "CheckBoxDrawer");
84 qmlRegisterType(url: QUrl(prefix + "CircularButtonStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "CircularButtonStyle");
85 qmlRegisterType(url: QUrl(prefix + "CircularGaugeStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "CircularGaugeStyle");
86 qmlRegisterType(url: QUrl(prefix + "CircularTickmarkLabelStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "CircularTickmarkLabelStyle");
87 qmlRegisterType(url: QUrl(prefix + "ComboBoxStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "ComboBoxStyle");
88 qmlRegisterType(url: QUrl(prefix + "CursorHandleStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "CursorHandleStyle");
89 qmlRegisterType(url: QUrl(prefix + "DelayButtonStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "DelayButtonStyle");
90 qmlRegisterType(url: QUrl(prefix + "FocusFrameStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "FocusFrameStyle");
91 qmlRegisterType(url: QUrl(prefix + "GaugeStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "GaugeStyle");
92 qmlRegisterType(url: QUrl(prefix + "GroupBoxStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "GroupBoxStyle");
93 qmlRegisterType(url: QUrl(prefix + "LeftArrowIcon.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "LeftArrowIcon");
94 qmlRegisterType(url: QUrl(prefix + "MenuBarStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "MenuBarStyle");
95 qmlRegisterType(url: QUrl(prefix + "PieMenuStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "PieMenuStyle");
96 qmlRegisterType(url: QUrl(prefix + "ProgressBarStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "ProgressBarStyle");
97 qmlRegisterType(url: QUrl(prefix + "RadioButtonStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "RadioButtonStyle");
98 qmlRegisterType(url: QUrl(prefix + "ScrollViewStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "ScrollViewStyle");
99 qmlRegisterType(url: QUrl(prefix + "SelectionHandleStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "SelectionHandleStyle");
100 qmlRegisterType(url: QUrl(prefix + "SliderStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "SliderStyle");
101 qmlRegisterType(url: QUrl(prefix + "SpinBoxStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "SpinBoxStyle");
102 qmlRegisterType(url: QUrl(prefix + "StatusBarStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "StatusBarStyle");
103 qmlRegisterType(url: QUrl(prefix + "StatusIndicatorStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "StatusIndicatorStyle");
104 qmlRegisterType(url: QUrl(prefix + "SwitchStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "SwitchStyle");
105 qmlRegisterType(url: QUrl(prefix + "TabViewStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "TabViewStyle");
106 qmlRegisterType(url: QUrl(prefix + "TableViewStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "TableViewStyle");
107 qmlRegisterType(url: QUrl(prefix + "TextAreaStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "TextAreaStyle");
108 qmlRegisterType(url: QUrl(prefix + "TextFieldStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "TextFieldStyle");
109 qmlRegisterType(url: QUrl(prefix + "ToggleButtonStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "ToggleButtonStyle");
110 qmlRegisterType(url: QUrl(prefix + "ToolBarStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "ToolBarStyle");
111 qmlRegisterType(url: QUrl(prefix + "ToolButtonStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "ToolButtonStyle");
112 qmlRegisterType(url: QUrl(prefix + "ToolButtonBackground.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "ToolButtonBackground");
113 qmlRegisterType(url: QUrl(prefix + "ToolButtonIndicator.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "ToolButtonIndicator");
114 qmlRegisterType(url: QUrl(prefix + "TumblerStyle.qml"), uri, versionMajor: 1, versionMinor: 0, qmlName: "TumblerStyle");
115 qmlRegisterType<QQuickTextHandle>(uri: "QtQuick.Controls.Styles.Flat", versionMajor: 1, versionMinor: 0, qmlName: "TextHandle");
116}
117
118QT_END_NAMESPACE
119

source code of qtquickcontrols/src/extras/Styles/Flat/flatstyleplugin.cpp