diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-08-10 16:25:26 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-08-26 11:46:09 +0200 |
commit | b47e26d29db05ecf87f74815e37e0bf7394d06ba (patch) | |
tree | 853e309cbc88d6b936fcfe4b0709d49a8f001e1b /src | |
parent | 9824a71f1d1754485072d66fbac2c98854ace52a (diff) |
Register QQuickDummyType as anonymous type
This way we get to declare a QML_ADDED_IN_VERSION. This is necessary for
version 2.x of the module to be found when version 6.x is registered.
Task-number: QTBUG-85151
Change-Id: Ia156763ffa2ecc6a35f0421c68df85fba646cec7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quickcontrols2/qquickdummyregistration_p.h | 67 | ||||
-rw-r--r-- | src/quickcontrols2/quickcontrols2.pro | 1 |
2 files changed, 68 insertions, 0 deletions
diff --git a/src/quickcontrols2/qquickdummyregistration_p.h b/src/quickcontrols2/qquickdummyregistration_p.h new file mode 100644 index 00000000..4d7fe5e4 --- /dev/null +++ b/src/quickcontrols2/qquickdummyregistration_p.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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$ +** +****************************************************************************/ + +#ifndef QQUICKDUMMYREGISTRATION_H +#define QQUICKDUMMYREGISTRATION_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQml/qqml.h> + +QT_BEGIN_NAMESPACE + +// QtQuick.Controls has no types, so if we didn't have this dummy type, +// we'd have no way of specifying the version when the module was added, +// and 6.0 would be the only version that gets registered: QTBUG-85151 +struct QQuickDummyType +{ + Q_GADGET + QML_ANONYMOUS + QML_ADDED_IN_VERSION(2, 0) +}; + +QT_END_NAMESPACE + +#endif // QQUICKDUMMYREGISTRATION_H diff --git a/src/quickcontrols2/quickcontrols2.pro b/src/quickcontrols2/quickcontrols2.pro index 686eed7b..5383f8d8 100644 --- a/src/quickcontrols2/quickcontrols2.pro +++ b/src/quickcontrols2/quickcontrols2.pro @@ -8,6 +8,7 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII HEADERS += \ $$PWD/qtquickcontrols2global.h \ + $$PWD/qquickdummyregistration_p.h \ $$PWD/qquickstyle.h \ $$PWD/qquickstyle_p.h \ $$PWD/qquickstyleplugin_p.h |