diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-10-22 14:06:25 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-10-25 11:22:34 +0000 |
commit | b26da0a8cdf3b342e42055f16190867aabf7aaf0 (patch) | |
tree | b63b9e767b63afa3e1fc075094f42c1c4227e9f2 | |
parent | 6383908085e1b78b2ef92fb6a8665709ef48a519 (diff) |
Make QQmlDirParser and QQmlError available in QmlDevTools
We will need them for the QML language server. Also, always build all of
QQmlDirParser. The QT_CREATOR condition is mostly useless.
Change-Id: I476864b55f6ff3953c11e7887525a043a9405e00
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/qml/qml.pro | 1 | ||||
-rw-r--r-- | src/qml/qml/qml.pri | 4 | ||||
-rw-r--r-- | src/qml/qml/qqmlengine_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlexpression.cpp | 1 | ||||
-rw-r--r-- | src/qml/qml/qqmlglobal_p.h | 10 | ||||
-rw-r--r-- | src/qml/qmldirparser/qmldirparser.pri | 11 | ||||
-rw-r--r-- | src/qml/qmldirparser/qqmldirparser.cpp (renamed from src/qml/qml/qqmldirparser.cpp) | 2 | ||||
-rw-r--r-- | src/qml/qmldirparser/qqmldirparser_p.h (renamed from src/qml/qml/qqmldirparser_p.h) | 4 | ||||
-rw-r--r-- | src/qml/qmldirparser/qqmlerror.cpp (renamed from src/qml/qml/qqmlerror.cpp) | 16 | ||||
-rw-r--r-- | src/qml/qmldirparser/qqmlerror.h (renamed from src/qml/qml/qqmlerror.h) | 4 | ||||
-rw-r--r-- | src/qml/qmldirparser/qqmlsourcecoordinate_p.h | 72 | ||||
-rw-r--r-- | src/qmldevtools/qmldevtools.pro | 1 |
12 files changed, 103 insertions, 25 deletions
diff --git a/src/qml/qml.pro b/src/qml/qml.pro index a76a87b153..a0af11b2da 100644 --- a/src/qml/qml.pro +++ b/src/qml/qml.pro @@ -73,6 +73,7 @@ include(jsruntime/jsruntime.pri) include(jit/jit.pri) include(qml/qml.pri) include(debugger/debugger.pri) +include(qmldirparser/qmldirparser.pri) qtConfig(qml-animation) { include(animations/animations.pri) } diff --git a/src/qml/qml/qml.pri b/src/qml/qml/qml.pri index 6d69294c17..ca13ce9211 100644 --- a/src/qml/qml/qml.pri +++ b/src/qml/qml/qml.pri @@ -18,7 +18,6 @@ SOURCES += \ $$PWD/qqmlparserstatus.cpp \ $$PWD/qqmltypeloader.cpp \ $$PWD/qqmlinfo.cpp \ - $$PWD/qqmlerror.cpp \ $$PWD/qqmlvaluetype.cpp \ $$PWD/qqmlcleanup.cpp \ $$PWD/qqmlpropertycache.cpp \ @@ -44,7 +43,6 @@ SOURCES += \ $$PWD/qqmltypewrapper.cpp \ $$PWD/qqmlfileselector.cpp \ $$PWD/qqmlobjectcreator.cpp \ - $$PWD/qqmldirparser.cpp \ $$PWD/qqmldelayedcallqueue.cpp \ $$PWD/qqmlloggingcategory.cpp @@ -81,7 +79,6 @@ HEADERS += \ $$PWD/qqmllist.h \ $$PWD/qqmllist_p.h \ $$PWD/qqmldata_p.h \ - $$PWD/qqmlerror.h \ $$PWD/qqmlvaluetype_p.h \ $$PWD/qqmlcleanup_p.h \ $$PWD/qqmlpropertycache_p.h \ @@ -112,7 +109,6 @@ HEADERS += \ $$PWD/qqmlfileselector_p.h \ $$PWD/qqmlfileselector.h \ $$PWD/qqmlobjectcreator_p.h \ - $$PWD/qqmldirparser_p.h \ $$PWD/qqmldelayedcallqueue_p.h \ $$PWD/qqmlloggingcategory_p.h diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h index 3caa6ec138..70e188dc1c 100644 --- a/src/qml/qml/qqmlengine_p.h +++ b/src/qml/qml/qqmlengine_p.h @@ -64,7 +64,6 @@ #include "qqmlproperty_p.h" #include "qqmlpropertycache_p.h" #include "qqmlmetatype_p.h" -#include "qqmldirparser_p.h" #include <private/qintrusivelist_p.h> #include <private/qrecyclepool_p.h> #include <private/qfieldlist_p.h> @@ -80,6 +79,7 @@ #include <private/qv8engine_p.h> #include <private/qjsengine_p.h> +#include <private/qqmldirparser_p.h> QT_BEGIN_NAMESPACE diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp index 0c1ffbf3a0..ac2629979f 100644 --- a/src/qml/qml/qqmlexpression.cpp +++ b/src/qml/qml/qqmlexpression.cpp @@ -46,6 +46,7 @@ #include "qqmlscriptstring_p.h" #include "qqmlbinding_p.h" #include <private/qv8engine_p.h> +#include <private/qqmlsourcecoordinate_p.h> #include <QtCore/qdebug.h> diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h index 302fdd56c4..818537560c 100644 --- a/src/qml/qml/qqmlglobal_p.h +++ b/src/qml/qml/qqmlglobal_p.h @@ -174,16 +174,6 @@ T qmlobject_cast(QObject *object) return 0; } -inline quint16 qmlSourceCoordinate(int n) -{ - return (n > 0 && n <= static_cast<int>(USHRT_MAX)) ? static_cast<quint16>(n) : 0; -} - -inline int qmlSourceCoordinate(quint16 n) -{ - return (n == 0) ? -1 : static_cast<int>(n); -} - #define IS_SIGNAL_CONNECTED(Sender, SenderType, Name, Arguments) \ do { \ QObject *sender = (Sender); \ diff --git a/src/qml/qmldirparser/qmldirparser.pri b/src/qml/qmldirparser/qmldirparser.pri new file mode 100644 index 0000000000..660e7b395a --- /dev/null +++ b/src/qml/qmldirparser/qmldirparser.pri @@ -0,0 +1,11 @@ +INCLUDEPATH += $$PWD +INCLUDEPATH += $$OUT_PWD + +HEADERS += \ + $$PWD/qqmldirparser_p.h \ + $$PWD/qqmlerror.h \ + $$PWD/qqmlsourcecoordinate_p.h + +SOURCES += \ + $$PWD/qqmldirparser.cpp \ + $$PWD/qqmlerror.cpp diff --git a/src/qml/qml/qqmldirparser.cpp b/src/qml/qmldirparser/qqmldirparser.cpp index d87bf433b8..e944b52e47 100644 --- a/src/qml/qml/qqmldirparser.cpp +++ b/src/qml/qmldirparser/qqmldirparser.cpp @@ -367,12 +367,10 @@ QList<QQmlDirParser::Script> QQmlDirParser::scripts() const return _scripts; } -#ifdef QT_CREATOR QList<QQmlDirParser::TypeInfo> QQmlDirParser::typeInfos() const { return _typeInfos; } -#endif bool QQmlDirParser::designerSupported() const { diff --git a/src/qml/qml/qqmldirparser_p.h b/src/qml/qmldirparser/qqmldirparser_p.h index d7e29813d1..cff9cb11a4 100644 --- a/src/qml/qml/qqmldirparser_p.h +++ b/src/qml/qmldirparser/qqmldirparser_p.h @@ -122,7 +122,6 @@ public: QList<Plugin> plugins() const; bool designerSupported() const; -#ifdef QT_CREATOR struct TypeInfo { TypeInfo() {} @@ -133,7 +132,6 @@ public: }; QList<TypeInfo> typeInfos() const; -#endif QString className() const; @@ -149,9 +147,7 @@ private: QList<Script> _scripts; QList<Plugin> _plugins; bool _designerSupported; -#ifdef QT_CREATOR QList<TypeInfo> _typeInfos; -#endif QString _className; }; diff --git a/src/qml/qml/qqmlerror.cpp b/src/qml/qmldirparser/qqmlerror.cpp index 61e9a3f37e..5e181f7e27 100644 --- a/src/qml/qml/qqmlerror.cpp +++ b/src/qml/qmldirparser/qqmlerror.cpp @@ -38,15 +38,17 @@ ****************************************************************************/ #include "qqmlerror.h" -#include "qqmlglobal_p.h" +#include "qqmlsourcecoordinate_p.h" #include <QtCore/qdebug.h> #include <QtCore/qfile.h> #include <QtCore/qstringlist.h> #include <QtCore/qvector.h> -#include <QtCore/qpointer.h> -#include <private/qv4errorobject_p.h> +#ifndef QT_NO_QOBJECT +#include <QtCore/qobject.h> +#include <QtCore/qpointer.h> +#endif QT_BEGIN_NAMESPACE @@ -85,11 +87,13 @@ public: quint16 line; quint16 column; QtMsgType messageType; +#ifndef QT_NO_QOBJECT QPointer<QObject> object; +#endif }; QQmlErrorPrivate::QQmlErrorPrivate() -: line(0), column(0), messageType(QtMsgType::QtWarningMsg), object() +: line(0), column(0), messageType(QtMsgType::QtWarningMsg) { } @@ -125,7 +129,9 @@ QQmlError &QQmlError::operator=(const QQmlError &other) d->description = other.d->description; d->line = other.d->line; d->column = other.d->column; +#ifndef QT_NO_QOBJECT d->object = other.d->object; +#endif d->messageType = other.d->messageType; } return *this; @@ -227,6 +233,7 @@ void QQmlError::setColumn(int column) d->column = qmlSourceCoordinate(column); } +#ifndef QT_NO_QOBJECT /*! Returns the nearest object where this error occurred. Exceptions in bound property expressions set this to the object @@ -249,6 +256,7 @@ void QQmlError::setObject(QObject *object) d = new QQmlErrorPrivate; d->object = object; } +#endif // QT_NO_QOBJECT /*! \since 5.9 diff --git a/src/qml/qml/qqmlerror.h b/src/qml/qmldirparser/qqmlerror.h index ef529e3828..f4221358e9 100644 --- a/src/qml/qml/qqmlerror.h +++ b/src/qml/qmldirparser/qqmlerror.h @@ -68,8 +68,12 @@ public: void setLine(int); int column() const; void setColumn(int); + +#ifndef QT_NO_QOBJECT QObject *object() const; void setObject(QObject *); +#endif + QtMsgType messageType() const; void setMessageType(QtMsgType messageType); diff --git a/src/qml/qmldirparser/qqmlsourcecoordinate_p.h b/src/qml/qmldirparser/qqmlsourcecoordinate_p.h new file mode 100644 index 0000000000..76ac741ae8 --- /dev/null +++ b/src/qml/qmldirparser/qqmlsourcecoordinate_p.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQml module 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$ +** +****************************************************************************/ + +#ifndef QQMLSOURCECOORDINATE_P_H +#define QQMLSOURCECOORDINATE_P_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 <QtCore/qglobal.h> + +#include <climits> + +QT_BEGIN_NAMESPACE + +inline quint16 qmlSourceCoordinate(int n) +{ + return (n > 0 && n <= static_cast<int>(USHRT_MAX)) ? static_cast<quint16>(n) : 0; +} + +inline int qmlSourceCoordinate(quint16 n) +{ + return (n == 0) ? -1 : static_cast<int>(n); +} + +QT_END_NAMESPACE + +#endif // QQMLSOURCECOORDINATE_P_H diff --git a/src/qmldevtools/qmldevtools.pro b/src/qmldevtools/qmldevtools.pro index 05aa6f66f5..45029400b9 100644 --- a/src/qmldevtools/qmldevtools.pro +++ b/src/qmldevtools/qmldevtools.pro @@ -17,5 +17,6 @@ include(../qml/parser/parser.pri) include(../qml/jsruntime/jsruntime.pri) include(../qml/compiler/compiler.pri) include(../qml/memory/memory.pri) +include(../qml/qmldirparser/qmldirparser.pri) load(qt_module) |