From 583bd9f8913dddfea3162662af7c6f48b69bb0fa Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 26 Oct 2020 22:34:34 +0100 Subject: Add a module describing the qmltypes format It's turtles all the way down. And now we can verify builtins.qmltypes using qmllint. Change-Id: I10c98ff8837c04838c3fd9803ef4ea0fd5d7bd0e Reviewed-by: Fabian Kosmale Reviewed-by: Qt CI Bot Reviewed-by: Ulf Hermann --- src/imports/CMakeLists.txt | 1 + src/imports/imports.pro | 3 ++- src/imports/tooling/CMakeLists.txt | 32 ++++++++++++++++++++++ src/imports/tooling/Component.qml | 55 ++++++++++++++++++++++++++++++++++++++ src/imports/tooling/Enum.qml | 46 +++++++++++++++++++++++++++++++ src/imports/tooling/Member.qml | 44 ++++++++++++++++++++++++++++++ src/imports/tooling/Method.qml | 46 +++++++++++++++++++++++++++++++ src/imports/tooling/Module.qml | 45 +++++++++++++++++++++++++++++++ src/imports/tooling/Parameter.qml | 45 +++++++++++++++++++++++++++++++ src/imports/tooling/Property.qml | 49 +++++++++++++++++++++++++++++++++ src/imports/tooling/Signal.qml | 45 +++++++++++++++++++++++++++++++ src/imports/tooling/qmldir | 10 +++++++ src/imports/tooling/tooling.pro | 8 ++++++ 13 files changed, 428 insertions(+), 1 deletion(-) create mode 100644 src/imports/tooling/CMakeLists.txt create mode 100644 src/imports/tooling/Component.qml create mode 100644 src/imports/tooling/Enum.qml create mode 100644 src/imports/tooling/Member.qml create mode 100644 src/imports/tooling/Method.qml create mode 100644 src/imports/tooling/Module.qml create mode 100644 src/imports/tooling/Parameter.qml create mode 100644 src/imports/tooling/Property.qml create mode 100644 src/imports/tooling/Signal.qml create mode 100644 src/imports/tooling/qmldir create mode 100644 src/imports/tooling/tooling.pro (limited to 'src/imports') diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt index 9df5367295..79a6a86016 100644 --- a/src/imports/CMakeLists.txt +++ b/src/imports/CMakeLists.txt @@ -4,6 +4,7 @@ add_subdirectory(builtins) add_subdirectory(qtqml) add_subdirectory(models) add_subdirectory(labsmodels) +add_subdirectory(tooling) if(QT_FEATURE_qml_itemmodel) add_subdirectory(folderlistmodel) endif() diff --git a/src/imports/imports.pro b/src/imports/imports.pro index c97da5809f..38e6105c8a 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -5,7 +5,8 @@ SUBDIRS += \ builtins \ qtqml \ models \ - labsmodels + labsmodels \ + tooling qtConfig(qml-itemmodel): SUBDIRS += folderlistmodel qtConfig(qml-worker-script): SUBDIRS += workerscript diff --git a/src/imports/tooling/CMakeLists.txt b/src/imports/tooling/CMakeLists.txt new file mode 100644 index 0000000000..0a638f3017 --- /dev/null +++ b/src/imports/tooling/CMakeLists.txt @@ -0,0 +1,32 @@ +# Generated from tooling.pro. + +# special case begin +set(qml_files + "Component.qml" + "Enum.qml" + "Member.qml" + "Method.qml" + "Module.qml" + "Parameter.qml" + "Property.qml" + "Signal.qml" +) + +qt_internal_add_qml_module(quicktooling + URI "QtQuick.tooling" + VERSION "${CMAKE_PROJECT_VERSION}" + GENERATE_QMLTYPES + INSTALL_QMLTYPES +) + +set_source_files_properties(${qml_files} PROPERTIES + QT_QML_SOURCE_VERSION "1.2" +) + +qt6_target_qml_files(quicktooling + FILES + ${qml_files} +) + +# special case end + diff --git a/src/imports/tooling/Component.qml b/src/imports/tooling/Component.qml new file mode 100644 index 0000000000..5f628962a7 --- /dev/null +++ b/src/imports/tooling/Component.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QML + +QtObject { + default property list members + + property string file + required property string name + property string prototype + property var exports: [] + property var exportMetaObjectRevisions: [] + property string attachedType + property bool isSingleton: false + property bool isCreatable: name.length > 0 + property bool isComposite: false + property string accessSemantics: "reference" +} diff --git a/src/imports/tooling/Enum.qml b/src/imports/tooling/Enum.qml new file mode 100644 index 0000000000..cd5904b6b6 --- /dev/null +++ b/src/imports/tooling/Enum.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QML + +Member { + property string alias + property bool isFlag: false + property var values: [] +} diff --git a/src/imports/tooling/Member.qml b/src/imports/tooling/Member.qml new file mode 100644 index 0000000000..5fc1466ff0 --- /dev/null +++ b/src/imports/tooling/Member.qml @@ -0,0 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QML + +QtObject { + required property string name +} diff --git a/src/imports/tooling/Method.qml b/src/imports/tooling/Method.qml new file mode 100644 index 0000000000..f867a4eb27 --- /dev/null +++ b/src/imports/tooling/Method.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QML + +Member { + default property list parameters + property string type + property int revision: 0 +} diff --git a/src/imports/tooling/Module.qml b/src/imports/tooling/Module.qml new file mode 100644 index 0000000000..b03475fbaf --- /dev/null +++ b/src/imports/tooling/Module.qml @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QML + +QtObject { + default property list components + property var dependencies: [] +} diff --git a/src/imports/tooling/Parameter.qml b/src/imports/tooling/Parameter.qml new file mode 100644 index 0000000000..108a80098f --- /dev/null +++ b/src/imports/tooling/Parameter.qml @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QML + +QtObject { + required property string name + required property string type +} diff --git a/src/imports/tooling/Property.qml b/src/imports/tooling/Property.qml new file mode 100644 index 0000000000..7c335a1dc9 --- /dev/null +++ b/src/imports/tooling/Property.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QML + +Member { + required property string type + property bool isPointer: false + property bool isReadonly: false + property bool isList: false + property int revision: 0 + property string bindable +} diff --git a/src/imports/tooling/Signal.qml b/src/imports/tooling/Signal.qml new file mode 100644 index 0000000000..4ac1dc1fea --- /dev/null +++ b/src/imports/tooling/Signal.qml @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QML + +Member { + default property list parameters + property int revision: 0 +} diff --git a/src/imports/tooling/qmldir b/src/imports/tooling/qmldir new file mode 100644 index 0000000000..2235f36d40 --- /dev/null +++ b/src/imports/tooling/qmldir @@ -0,0 +1,10 @@ +module QtQuick.tooling + +Component 1.2 Component.qml +Enum 1.2 Enum.qml +Member 1.2 Member.qml +Method 1.2 Method.qml +Module 1.2 Module.qml +Parameter 1.2 Parameter.qml +Property 1.2 Property.qml +Signal 1.2 Signal.qml diff --git a/src/imports/tooling/tooling.pro b/src/imports/tooling/tooling.pro new file mode 100644 index 0000000000..e9edd286b4 --- /dev/null +++ b/src/imports/tooling/tooling.pro @@ -0,0 +1,8 @@ +TARGETPATH = QtQuick/tooling + +QML_FILES = \ + TestCase.qml \ + SignalSpy.qml \ + testlogger.js + +load(qml_module) -- cgit v1.2.3