aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-05-31 22:10:11 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-06-02 07:17:00 +0000
commit1af7f8a597138d57e4ea932572f0dd5c0832bcf0 (patch)
treedfb926db2cf12fc0e3f0f715a5421ffbce1624f2
parentc70ffcd0f1c21338df36bcfe276b57c8dbad0d50 (diff)
Add .qml files for the non-visual types
This makes the registration code in qtquickcontrols2plugin.cpp clean, consistent, and a bit less error-prone. I can't think of anything style specific in Action, ActionGroup, or ButtonGroup, but in theory, this mechanism would allow styles to even specify their own default values for certain properties if they wanted. Change-Id: I57e1c256d442f2383146808d0fe77355717b0ff2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/imports/controls/Action.qml40
-rw-r--r--src/imports/controls/ActionGroup.qml40
-rw-r--r--src/imports/controls/ButtonGroup.qml40
-rw-r--r--src/imports/controls/controls.pri3
-rw-r--r--src/imports/controls/qtquickcontrols2plugin.cpp14
5 files changed, 126 insertions, 11 deletions
diff --git a/src/imports/controls/Action.qml b/src/imports/controls/Action.qml
new file mode 100644
index 00000000..3ee2e44a
--- /dev/null
+++ b/src/imports/controls/Action.qml
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+
+T.Action { }
diff --git a/src/imports/controls/ActionGroup.qml b/src/imports/controls/ActionGroup.qml
new file mode 100644
index 00000000..6f4dfa40
--- /dev/null
+++ b/src/imports/controls/ActionGroup.qml
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+
+T.ActionGroup { }
diff --git a/src/imports/controls/ButtonGroup.qml b/src/imports/controls/ButtonGroup.qml
new file mode 100644
index 00000000..5c8550b3
--- /dev/null
+++ b/src/imports/controls/ButtonGroup.qml
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Templates 2.3 as T
+
+T.ButtonGroup { }
diff --git a/src/imports/controls/controls.pri b/src/imports/controls/controls.pri
index d2db9067..8c127643 100644
--- a/src/imports/controls/controls.pri
+++ b/src/imports/controls/controls.pri
@@ -14,9 +14,12 @@ SOURCES += \
QML_CONTROLS = \
$$PWD/AbstractButton.qml \
+ $$PWD/Action.qml \
+ $$PWD/ActionGroup.qml \
$$PWD/ApplicationWindow.qml \
$$PWD/BusyIndicator.qml \
$$PWD/Button.qml \
+ $$PWD/ButtonGroup.qml \
$$PWD/CheckBox.qml \
$$PWD/CheckDelegate.qml \
$$PWD/CheckIndicator.qml \
diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp
index 8457125e..a7bf096f 100644
--- a/src/imports/controls/qtquickcontrols2plugin.cpp
+++ b/src/imports/controls/qtquickcontrols2plugin.cpp
@@ -48,10 +48,6 @@
#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview)
#include <QtQuickControls2/private/qquicktumblerview_p.h>
#endif
-#include <QtQuickTemplates2/private/qquickaction_p.h>
-#include <QtQuickTemplates2/private/qquickactiongroup_p.h>
-#include <QtQuickTemplates2/private/qquickbuttongroup_p.h>
-#include <QtQuickTemplates2/private/qquickicon_p.h>
#include "qquickdefaultbusyindicator_p.h"
#include "qquickdefaultdial_p.h"
@@ -105,8 +101,7 @@ void QtQuickControls2Plugin::registerTypes(const char *uri)
qmlRegisterType(selector.select(QStringLiteral("ApplicationWindow.qml")), uri, 2, 0, "ApplicationWindow");
qmlRegisterType(selector.select(QStringLiteral("BusyIndicator.qml")), uri, 2, 0, "BusyIndicator");
qmlRegisterType(selector.select(QStringLiteral("Button.qml")), uri, 2, 0, "Button");
- qmlRegisterType<QQuickButtonGroup>(uri, 2, 0, "ButtonGroup");
- qmlRegisterType<QQuickButtonGroupAttached>();
+ qmlRegisterType(selector.select(QStringLiteral("ButtonGroup.qml")), uri, 2, 0, "ButtonGroup");
qmlRegisterType(selector.select(QStringLiteral("CheckBox.qml")), uri, 2, 0, "CheckBox");
qmlRegisterType(selector.select(QStringLiteral("CheckDelegate.qml")), uri, 2, 0, "CheckDelegate");
qmlRegisterType(selector.select(QStringLiteral("ComboBox.qml")), uri, 2, 0, "ComboBox");
@@ -149,7 +144,6 @@ void QtQuickControls2Plugin::registerTypes(const char *uri)
#endif
// QtQuick.Controls 2.1 (new types in Qt 5.8)
- qmlRegisterType<QQuickButtonGroup,1 >(uri, 2, 1, "ButtonGroup");
qmlRegisterType(selector.select(QStringLiteral("Dialog.qml")), uri, 2, 1, "Dialog");
qmlRegisterType(selector.select(QStringLiteral("DialogButtonBox.qml")), uri, 2, 1, "DialogButtonBox");
qmlRegisterType(selector.select(QStringLiteral("MenuSeparator.qml")), uri, 2, 1, "MenuSeparator");
@@ -161,10 +155,8 @@ void QtQuickControls2Plugin::registerTypes(const char *uri)
qmlRegisterType(selector.select(QStringLiteral("ScrollView.qml")), uri, 2, 2, "ScrollView");
// QtQuick.Controls 2.3 (new types in Qt 5.10)
- qmlRegisterType<QQuickAction>(uri, 2, 3, "Action");
- qmlRegisterType<QQuickActionGroup>(uri, 2, 3, "ActionGroup");
- qmlRegisterType<QQuickButtonGroup, 3>(uri, 2, 3, "ButtonGroup");
- qRegisterMetaType<QQuickIcon>();
+ qmlRegisterType(selector.select(QStringLiteral("Action.qml")), uri, 2, 3, "Action");
+ qmlRegisterType(selector.select(QStringLiteral("ActionGroup.qml")), uri, 2, 3, "ActionGroup");
}
static QObject *styleSingleton(QQmlEngine *engine, QJSEngine *scriptEngine)