1/****************************************************************************
2**
3** Copyright (C) 2017 The Qt Company Ltd.
4** Contact: http://www.qt.io/licensing/
5**
6** This file is part of the Qt Quick Templates 2 module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL3$
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 http://www.qt.io/terms-conditions. For further
15** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free
28** Software Foundation and appearing in the file LICENSE.GPL included in
29** the packaging of this file. Please review the following information to
30** ensure the GNU General Public License version 2.0 requirements will be
31** met: http://www.gnu.org/licenses/gpl-2.0.html.
32**
33** $QT_END_LICENSE$
34**
35****************************************************************************/
36
37#include <QtQml/qqmlextensionplugin.h>
38#include <QtQml/private/qqmlglobal_p.h>
39
40#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
41#include <QtQuickTemplates2/private/qquickaction_p.h>
42#include <QtQuickTemplates2/private/qquickactiongroup_p.h>
43#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
44#include <QtQuickTemplates2/private/qquickbusyindicator_p.h>
45#include <QtQuickTemplates2/private/qquickbutton_p.h>
46#include <QtQuickTemplates2/private/qquickbuttongroup_p.h>
47#include <QtQuickTemplates2/private/qquickcheckbox_p.h>
48#include <QtQuickTemplates2/private/qquickcheckdelegate_p.h>
49#include <QtQuickTemplates2/private/qquickcombobox_p.h>
50#include <QtQuickTemplates2/private/qquickcontrol_p.h>
51#include <QtQuickTemplates2/private/qquickcontainer_p.h>
52#include <QtQuickTemplates2/private/qquickdelaybutton_p.h>
53#include <QtQuickTemplates2/private/qquickdial_p.h>
54#include <QtQuickTemplates2/private/qquickdialog_p.h>
55#include <QtQuickTemplates2/private/qquickdialogbuttonbox_p.h>
56#include <QtQuickTemplates2/private/qquickdrawer_p.h>
57#include <QtQuickTemplates2/private/qquickframe_p.h>
58#include <QtQuickTemplates2/private/qquickgroupbox_p.h>
59#include <QtQuickTemplates2/private/qquickheaderview_p.h>
60#include <QtQuickTemplates2/private/qquickicon_p.h>
61#include <QtQuickTemplates2/private/qquickitemdelegate_p.h>
62#include <QtQuickTemplates2/private/qquicklabel_p.h>
63#include <QtQuickTemplates2/private/qquickmenu_p.h>
64#include <QtQuickTemplates2/private/qquickmenubar_p.h>
65#include <QtQuickTemplates2/private/qquickmenubaritem_p.h>
66#include <QtQuickTemplates2/private/qquickmenuitem_p.h>
67#include <QtQuickTemplates2/private/qquickmenuseparator_p.h>
68#include <QtQuickTemplates2/private/qquickoverlay_p.h>
69#include <QtQuickTemplates2/private/qquickpage_p.h>
70#include <QtQuickTemplates2/private/qquickpageindicator_p.h>
71#include <QtQuickTemplates2/private/qquickpaletteprovider_p.h>
72#include <QtQuickTemplates2/private/qquickpane_p.h>
73#include <QtQuickTemplates2/private/qquickpopup_p.h>
74#include <QtQuickTemplates2/private/qquickpopupanchors_p.h>
75#include <QtQuickTemplates2/private/qquickprogressbar_p.h>
76#include <QtQuickTemplates2/private/qquickradiobutton_p.h>
77#include <QtQuickTemplates2/private/qquickradiodelegate_p.h>
78#include <QtQuickTemplates2/private/qquickrangeslider_p.h>
79#include <QtQuickTemplates2/private/qquickroundbutton_p.h>
80#include <QtQuickTemplates2/private/qquickscrollbar_p.h>
81#include <QtQuickTemplates2/private/qquickscrollindicator_p.h>
82#include <QtQuickTemplates2/private/qquickscrollview_p.h>
83#include <QtQuickTemplates2/private/qquickshortcutcontext_p_p.h>
84#include <QtQuickTemplates2/private/qquickslider_p.h>
85#include <QtQuickTemplates2/private/qquickspinbox_p.h>
86#include <QtQuickTemplates2/private/qquicksplitview_p.h>
87#include <QtQuickTemplates2/private/qquickstackview_p.h>
88#include <QtQuickTemplates2/private/qquickswipe_p.h>
89#include <QtQuickTemplates2/private/qquickswipedelegate_p.h>
90#include <QtQuickTemplates2/private/qquickswipeview_p.h>
91#include <QtQuickTemplates2/private/qquickswitch_p.h>
92#include <QtQuickTemplates2/private/qquickswitchdelegate_p.h>
93#include <QtQuickTemplates2/private/qquicktabbar_p.h>
94#include <QtQuickTemplates2/private/qquicktabbutton_p.h>
95#include <QtQuickTemplates2/private/qquicktextarea_p.h>
96#include <QtQuickTemplates2/private/qquicktextfield_p.h>
97#include <QtQuickTemplates2/private/qquicktoolbar_p.h>
98#include <QtQuickTemplates2/private/qquicktoolbutton_p.h>
99#include <QtQuickTemplates2/private/qquicktoolseparator_p.h>
100#include <QtQuickTemplates2/private/qquicktooltip_p.h>
101#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview)
102#include <QtQuickTemplates2/private/qquicktumbler_p.h>
103#endif
104
105#if QT_CONFIG(shortcut)
106// qtdeclarative/src/quick/util/qquickshortcut.cpp
107typedef bool (*ShortcutContextMatcher)(QObject *, Qt::ShortcutContext);
108extern ShortcutContextMatcher qt_quick_shortcut_context_matcher();
109extern void qt_quick_set_shortcut_context_matcher(ShortcutContextMatcher matcher);
110#endif
111
112QT_BEGIN_NAMESPACE
113
114static void initProviders()
115{
116 QQuickPaletteProvider::init();
117}
118
119static void cleanupProviders()
120{
121 QQuickPaletteProvider::cleanup();
122}
123
124class QtQuickTemplates2Plugin: public QQmlExtensionPlugin
125{
126 Q_OBJECT
127 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
128
129public:
130 QtQuickTemplates2Plugin(QObject *parent = nullptr);
131 ~QtQuickTemplates2Plugin();
132
133 void registerTypes(const char *uri) override;
134
135private:
136 bool registered;
137#if QT_CONFIG(shortcut)
138 ShortcutContextMatcher originalContextMatcher;
139#endif
140};
141
142QtQuickTemplates2Plugin::QtQuickTemplates2Plugin(QObject *parent)
143 : QQmlExtensionPlugin(parent), registered(false)
144{
145 volatile auto initialization = &QQuickTemplates_initializeModule;
146 Q_UNUSED(initialization)
147#if QT_CONFIG(shortcut)
148 originalContextMatcher = qt_quick_shortcut_context_matcher();
149 qt_quick_set_shortcut_context_matcher(matcher: QQuickShortcutContext::matcher);
150#endif
151}
152
153QtQuickTemplates2Plugin::~QtQuickTemplates2Plugin()
154{
155 if (registered)
156 cleanupProviders();
157
158#if QT_CONFIG(shortcut)
159 qt_quick_set_shortcut_context_matcher(matcher: originalContextMatcher);
160#endif
161}
162
163void QtQuickTemplates2Plugin::registerTypes(const char *uri)
164{
165 registered = true;
166 initProviders();
167
168 // Register the latest version, even if there are no new types or new revisions for existing types yet.
169 // Before Qt 5.12, we would do the following:
170 //
171 // qmlRegisterModule(uri, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2...
172 //
173 // However, we want to align with the rest of Qt Quick which uses Qt's minor version.
174 qmlRegisterModule(uri, versionMajor: 2, QT_VERSION_MINOR);
175
176 // QtQuick.Templates 2.0 (originally introduced in Qt 5.7)
177 qmlRegisterType<QQuickAbstractButton>(uri, versionMajor: 2, versionMinor: 0, qmlName: "AbstractButton");
178 qmlRegisterType<QQuickApplicationWindow>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ApplicationWindow");
179 qmlRegisterAnonymousType<QQuickApplicationWindowAttached>(uri, versionMajor: 2);
180 qmlRegisterType<QQuickBusyIndicator>(uri, versionMajor: 2, versionMinor: 0, qmlName: "BusyIndicator");
181 qmlRegisterType<QQuickButton>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Button");
182 qmlRegisterType<QQuickButtonGroup>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ButtonGroup");
183 qmlRegisterAnonymousType<QQuickButtonGroupAttached>(uri, versionMajor: 2);
184 qmlRegisterType<QQuickCheckBox>(uri, versionMajor: 2, versionMinor: 0, qmlName: "CheckBox");
185 qmlRegisterType<QQuickCheckDelegate>(uri, versionMajor: 2, versionMinor: 0, qmlName: "CheckDelegate");
186 qmlRegisterType<QQuickComboBox>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ComboBox");
187 qmlRegisterType<QQuickContainer>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Container");
188 qmlRegisterType<QQuickControl>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Control");
189 qmlRegisterType<QQuickDial>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Dial");
190 qmlRegisterType<QQuickDrawer>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Drawer");
191 qmlRegisterType<QQuickFrame>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Frame");
192 qmlRegisterType<QQuickGroupBox>(uri, versionMajor: 2, versionMinor: 0, qmlName: "GroupBox");
193 qmlRegisterType<QQuickItemDelegate>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ItemDelegate");
194 qmlRegisterType<QQuickLabel>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Label");
195 qmlRegisterType<QQuickMenu>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Menu");
196 qmlRegisterType<QQuickMenuItem>(uri, versionMajor: 2, versionMinor: 0, qmlName: "MenuItem");
197 qmlRegisterAnonymousType<QQuickOverlay>(uri, versionMajor: 2);
198 qmlRegisterType<QQuickPage>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Page");
199 qmlRegisterType<QQuickPageIndicator>(uri, versionMajor: 2, versionMinor: 0, qmlName: "PageIndicator");
200 qmlRegisterType<QQuickPane>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Pane");
201 qmlRegisterType<QQuickPopup>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Popup");
202 qmlRegisterType<QQuickProgressBar>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ProgressBar");
203 qmlRegisterType<QQuickRadioButton>(uri, versionMajor: 2, versionMinor: 0, qmlName: "RadioButton");
204 qmlRegisterType<QQuickRadioDelegate>(uri, versionMajor: 2, versionMinor: 0, qmlName: "RadioDelegate");
205 qmlRegisterType<QQuickRangeSlider>(uri, versionMajor: 2, versionMinor: 0, qmlName: "RangeSlider");
206 qmlRegisterAnonymousType<QQuickRangeSliderNode>(uri, versionMajor: 2);
207 qmlRegisterType<QQuickScrollBar>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ScrollBar");
208 qmlRegisterAnonymousType<QQuickScrollBarAttached>(uri, versionMajor: 2);
209 qmlRegisterType<QQuickScrollIndicator>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ScrollIndicator");
210 qmlRegisterAnonymousType<QQuickScrollIndicatorAttached>(uri, versionMajor: 2);
211 qmlRegisterType<QQuickSlider>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Slider");
212 qmlRegisterType<QQuickSpinBox>(uri, versionMajor: 2, versionMinor: 0, qmlName: "SpinBox");
213 qmlRegisterAnonymousType<QQuickSpinButton>(uri, versionMajor: 2);
214 qmlRegisterType<QQuickStackView>(uri, versionMajor: 2, versionMinor: 0, qmlName: "StackView");
215 qmlRegisterAnonymousType<QQuickStackViewAttached>(uri, versionMajor: 2);
216 qmlRegisterAnonymousType<QQuickSwipe>(uri, versionMajor: 2);
217 qmlRegisterType<QQuickSwipeDelegate>(uri, versionMajor: 2, versionMinor: 0, qmlName: "SwipeDelegate");
218 qmlRegisterType<QQuickSwipeView>(uri, versionMajor: 2, versionMinor: 0, qmlName: "SwipeView");
219 qmlRegisterAnonymousType<QQuickSwipeViewAttached>(uri, versionMajor: 2);
220 qmlRegisterType<QQuickSwitch>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Switch");
221 qmlRegisterType<QQuickSwitchDelegate>(uri, versionMajor: 2, versionMinor: 0, qmlName: "SwitchDelegate");
222 qmlRegisterType<QQuickTabBar>(uri, versionMajor: 2, versionMinor: 0, qmlName: "TabBar");
223 qmlRegisterType<QQuickTabButton>(uri, versionMajor: 2, versionMinor: 0, qmlName: "TabButton");
224 qmlRegisterType<QQuickTextArea>(uri, versionMajor: 2, versionMinor: 0, qmlName: "TextArea");
225 qmlRegisterAnonymousType<QQuickTextAreaAttached>(uri, versionMajor: 2);
226 qmlRegisterType<QQuickTextField>(uri, versionMajor: 2, versionMinor: 0, qmlName: "TextField");
227 qmlRegisterType<QQuickToolBar>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ToolBar");
228 qmlRegisterType<QQuickToolButton>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ToolButton");
229 qmlRegisterType<QQuickToolTip>(uri, versionMajor: 2, versionMinor: 0, qmlName: "ToolTip");
230 qmlRegisterAnonymousType<QQuickToolTipAttached>(uri, versionMajor: 2);
231#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview)
232 qmlRegisterAnonymousType<QQuickTumblerAttached>(uri, versionMajor: 2);
233 qmlRegisterType<QQuickTumbler>(uri, versionMajor: 2, versionMinor: 0, qmlName: "Tumbler");
234#endif
235
236 // NOTE: register the latest revisions of all template/control base classes to
237 // make revisioned properties available to their subclasses (synced with Qt 5.7)
238 qmlRegisterRevision<QQuickItem, 7>(uri, versionMajor: 2, versionMinor: 0);
239 qmlRegisterRevision<QQuickText, 6>(uri, versionMajor: 2, versionMinor: 0);
240 qmlRegisterRevision<QQuickTextInput, 7>(uri, versionMajor: 2, versionMinor: 0);
241 qmlRegisterRevision<QQuickTextEdit, 7>(uri, versionMajor: 2, versionMinor: 0);
242 qmlRegisterRevision<QQuickWindow, 2>(uri, versionMajor: 2, versionMinor: 0);
243 qmlRegisterRevision<QWindow, 3>(uri, versionMajor: 2, versionMinor: 0);
244
245 // QtQuick.Templates 2.1 (new types and revisions in Qt 5.8)
246 qmlRegisterType<QQuickButtonGroup, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "ButtonGroup");
247 qmlRegisterType<QQuickComboBox, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "ComboBox");
248 qmlRegisterType<QQuickContainer, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "Container");
249 qmlRegisterType<QQuickDialog>(uri, versionMajor: 2, versionMinor: 1, qmlName: "Dialog");
250 qmlRegisterType<QQuickDialogButtonBox>(uri, versionMajor: 2, versionMinor: 1, qmlName: "DialogButtonBox");
251 qmlRegisterAnonymousType<QQuickDialogButtonBoxAttached>(uri, versionMajor: 2);
252 qmlRegisterType<QQuickMenuSeparator>(uri, versionMajor: 2, versionMinor: 1, qmlName: "MenuSeparator");
253 qmlRegisterType<QQuickPage, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "Page");
254 qmlRegisterType<QQuickPopup, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "Popup");
255 qmlRegisterType<QQuickRangeSlider, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "RangeSlider");
256 qmlRegisterType<QQuickRoundButton>(uri, versionMajor: 2, versionMinor: 1, qmlName: "RoundButton");
257 qmlRegisterType<QQuickSlider, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "Slider");
258 qmlRegisterType<QQuickSpinBox, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "SpinBox");
259 qmlRegisterType<QQuickStackView, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "StackView");
260 qmlRegisterType<QQuickSwipeDelegate, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "SwipeDelegate");
261 qmlRegisterType<QQuickSwipeView, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "SwipeView");
262 qmlRegisterType<QQuickTextArea, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "TextArea");
263 qmlRegisterType<QQuickTextField, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "TextField");
264 qmlRegisterType<QQuickToolSeparator>(uri, versionMajor: 2, versionMinor: 1, qmlName: "ToolSeparator");
265#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview)
266 qmlRegisterType<QQuickTumbler, 1>(uri, versionMajor: 2, versionMinor: 1, qmlName: "Tumbler");
267#endif
268
269 // QtQuick.Templates 2.2 (new types and revisions in Qt 5.9)
270 qmlRegisterType<QQuickAbstractButton, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "AbstractButton");
271 qmlRegisterType<QQuickComboBox, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "ComboBox");
272 qmlRegisterType<QQuickDelayButton>(uri, versionMajor: 2, versionMinor: 2, qmlName: "DelayButton");
273 qmlRegisterType<QQuickDial, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "Dial");
274 qmlRegisterType<QQuickDrawer, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "Drawer");
275 qmlRegisterType<QQuickRangeSlider, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "RangeSlider");
276 qmlRegisterType<QQuickScrollBar, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "ScrollBar");
277 qmlRegisterType<QQuickScrollView>(uri, versionMajor: 2, versionMinor: 2, qmlName: "ScrollView");
278 qmlRegisterType<QQuickSlider, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "Slider");
279 qmlRegisterType<QQuickSpinBox, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "SpinBox");
280 qmlRegisterType<QQuickSwipeDelegate, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "SwipeDelegate");
281 qmlRegisterType<QQuickSwipeView, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "SwipeView");
282 qmlRegisterType<QQuickTabBar, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "TabBar");
283#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview)
284 qmlRegisterType<QQuickTumbler, 2>(uri, versionMajor: 2, versionMinor: 2, qmlName: "Tumbler");
285#endif
286
287 // NOTE: register the latest revisions of all template/control base classes to
288 // make revisioned properties available to their subclasses (synced with Qt 5.9)
289 qmlRegisterRevision<QQuickText, 9>(uri, versionMajor: 2, versionMinor: 2);
290 qmlRegisterRevision<QQuickTextInput, 9>(uri, versionMajor: 2, versionMinor: 2);
291 qmlRegisterRevision<QQuickWindowQmlImpl, 3>(uri, versionMajor: 2, versionMinor: 2);
292
293 // QtQuick.Templates 2.3 (new types and revisions in Qt 5.10)
294 qmlRegisterType<QQuickAbstractButton, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "AbstractButton");
295 qmlRegisterType<QQuickAction>(uri, versionMajor: 2, versionMinor: 3, qmlName: "Action");
296 qmlRegisterType<QQuickActionGroup>(uri, versionMajor: 2, versionMinor: 3, qmlName: "ActionGroup");
297 qmlRegisterType<QQuickApplicationWindow, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "ApplicationWindow");
298 qmlRegisterType<QQuickButtonGroup, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "ButtonGroup");
299 qmlRegisterType<QQuickControl, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "Control");
300 qmlRegisterType<QQuickContainer, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "Container");
301 qmlRegisterType<QQuickDialog, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "Dialog");
302 qmlRegisterType<QQuickDialogButtonBox, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "DialogButtonBox");
303 qmlRegisterAnonymousType<QQuickIcon>(uri, versionMajor: 2);
304 qRegisterMetaType<QQuickIcon>();
305 qmlRegisterType<QQuickLabel, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "Label");
306 qmlRegisterType<QQuickMenu, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "Menu");
307 qmlRegisterType<QQuickMenuBar>(uri, versionMajor: 2, versionMinor: 3, qmlName: "MenuBar");
308 qmlRegisterType<QQuickMenuBarItem>(uri, versionMajor: 2, versionMinor: 3, qmlName: "MenuBarItem");
309 qmlRegisterType<QQuickMenuItem, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "MenuItem");
310 qmlRegisterUncreatableType<QQuickOverlay>(uri, versionMajor: 2, versionMinor: 3, qmlName: "Overlay", QStringLiteral("Overlay is only available as an attached property."));
311 qmlRegisterAnonymousType<QQuickOverlayAttached>(uri, versionMajor: 2);
312 qmlRegisterType<QQuickPopup, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "Popup");
313 qmlRegisterType<QQuickRangeSlider, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "RangeSlider");
314 qmlRegisterType<QQuickScrollBar, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "ScrollBar");
315 qmlRegisterType<QQuickScrollIndicator, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "ScrollIndicator");
316 qmlRegisterType<QQuickSlider, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "Slider");
317 qmlRegisterType<QQuickSpinBox, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "SpinBox");
318 qmlRegisterType<QQuickTextArea, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "TextArea");
319 qmlRegisterType<QQuickTextField, 3>(uri, versionMajor: 2, versionMinor: 3, qmlName: "TextField");
320
321 // NOTE: register the latest revisions of all template/control base classes to
322 // make revisioned properties available to their subclasses (synced with Qt 5.10)
323 qmlRegisterRevision<QQuickText, 10>(uri, versionMajor: 2, versionMinor: 3);
324 qmlRegisterRevision<QQuickTextEdit, 10>(uri, versionMajor: 2, versionMinor: 3);
325
326 // QtQuick.Templates 2.4 (new types and revisions in Qt 5.11)
327 qmlRegisterType<QQuickAbstractButton, 4>(uri, versionMajor: 2, versionMinor: 4, qmlName: "AbstractButton");
328 qmlRegisterType<QQuickButtonGroup, 4>(uri, versionMajor: 2, versionMinor: 4, qmlName: "ButtonGroup");
329 qmlRegisterType<QQuickCheckBox, 4>(uri, versionMajor: 2, versionMinor: 4, qmlName: "CheckBox");
330 qmlRegisterType<QQuickCheckDelegate, 4>(uri, versionMajor: 2, versionMinor: 4, qmlName: "CheckDelegate");
331 qmlRegisterType<QQuickScrollBar, 4>(uri, versionMajor: 2, versionMinor: 4, qmlName: "ScrollBar");
332 qmlRegisterType<QQuickScrollIndicator, 4>(uri, versionMajor: 2, versionMinor: 4, qmlName: "ScrollIndicator");
333 qmlRegisterType<QQuickSpinBox, 4>(uri, versionMajor: 2, versionMinor: 4, qmlName: "SpinBox");
334
335 // QtQuick.Templates 2.5 (new types and revisions in Qt 5.12)
336 qmlRegisterType<QQuickAbstractButton, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "AbstractButton");
337 qmlRegisterType<QQuickDialogButtonBox, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "DialogButtonBox");
338 qmlRegisterType<QQuickComboBox, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "ComboBox");
339 qmlRegisterType<QQuickControl, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "Control");
340 qmlRegisterType<QQuickContainer, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "Container");
341 qmlRegisterType<QQuickDial, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "Dial");
342 qmlRegisterType<QQuickDialog, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "Dialog");
343 qmlRegisterType<QQuickGroupBox, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "GroupBox");
344 qmlRegisterType<QQuickLabel, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "Label");
345 qmlRegisterType<QQuickPage, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "Page");
346 qmlRegisterType<QQuickPopup, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "Popup");
347 qmlRegisterAnonymousType<QQuickPopupAnchors>(uri, versionMajor: 2);
348 qmlRegisterType<QQuickRangeSlider, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "RangeSlider");
349 qmlRegisterType<QQuickSlider, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "Slider");
350 qmlRegisterType<QQuickSpinBox, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "SpinBox");
351 qmlRegisterType<QQuickTextArea, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "TextArea");
352 qmlRegisterType<QQuickTextField, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "TextField");
353 qmlRegisterType<QQuickToolTip, 5>(uri, versionMajor: 2, versionMinor: 5, qmlName: "ToolTip");
354
355 // QtQuick.Templates 2.13 (new types and revisions in Qt 5.13)
356 qmlRegisterType<QQuickSplitView>(uri, versionMajor: 2, versionMinor: 13, qmlName: "SplitView");
357 qmlRegisterAnonymousType<QQuickSplitViewAttached>(uri, versionMajor: 2);
358 qmlRegisterUncreatableType<QQuickSplitHandleAttached>(uri, versionMajor: 2, versionMinor: 13, qmlName: "SplitHandle",
359 QStringLiteral("SplitHandle is only available as an attached property."));
360 qmlRegisterAnonymousType<QQuickSplitHandleAttached>(uri, versionMajor: 2);
361
362 // QtQuick.Templates 2.14 (new types and revisions in Qt 5.14)
363 qmlRegisterType<QQuickComboBox, 14>(uri, versionMajor: 2, versionMinor: 14, qmlName: "ComboBox");
364
365 // QtQuick.Templates 2.15 (new types and revisions in Qt 5.15)
366 qmlRegisterType<QQuickComboBox, 15>(uri, versionMajor: 2, versionMinor: 15, qmlName: "ComboBox");
367 // Register QQuickTableView here to expose headerView's base, with a irregular type name to 'hide' it.
368 qmlRegisterType<QQuickTableView, 15>(uri, versionMajor: 2, versionMinor: 15, qmlName: "__TableView__");
369 qmlRegisterType<QQuickHorizontalHeaderView>(uri, versionMajor: 2, versionMinor: 15, qmlName: "HorizontalHeaderView");
370 qmlRegisterType<QQuickVerticalHeaderView>(uri, versionMajor: 2, versionMinor: 15, qmlName: "VerticalHeaderView");
371}
372
373QT_END_NAMESPACE
374
375#include "qtquicktemplates2plugin.moc"
376

source code of qtquickcontrols2/src/imports/templates/qtquicktemplates2plugin.cpp