diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2020-02-27 10:49:14 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-03-02 10:35:50 +0100 |
commit | 8ab237edf170f5b0482dccf5169868e5c7c47771 (patch) | |
tree | cca2d3faa0a8553a452d9139ac7442c3da25c0f8 /src/qml/qml/qqmlerror.cpp | |
parent | d8f6f41c334d14c4712b1dc16554f80bb1290e24 (diff) |
Restore offset/length in QQmlJS::DiagnosticMessage
This is needed in a few places outside of declarative, so this change
restores the loc member in DiagnosticMessage and moves
QQmlJS::AST::SourceLocation into common's QQmlJS namespace/directory.
QQmlError is unaffected and retains only line/column.
Amends d4d197d06279f9257647628f7e1ccc9ec763a6bb
Change-Id: Ifb9d344228e3c6e9e26fc4fe112686f9336ea2b2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlerror.cpp')
-rw-r--r-- | src/qml/qml/qqmlerror.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlerror.cpp b/src/qml/qml/qqmlerror.cpp index 0b94ed3b49..da585d2126 100644 --- a/src/qml/qml/qqmlerror.cpp +++ b/src/qml/qml/qqmlerror.cpp @@ -77,12 +77,15 @@ QT_BEGIN_NAMESPACE \sa QQuickView::errors(), QQmlComponent::errors() */ -class QQmlErrorPrivate : public QQmlJS::DiagnosticMessage +class QQmlErrorPrivate { public: - QQmlErrorPrivate() { type = QtWarningMsg; } QUrl url; QPointer<QObject> object; + QString message; + QtMsgType type = QtWarningMsg; + int line = -1; + int column = -1; }; /*! @@ -185,7 +188,7 @@ void QQmlError::setDescription(const QString &description) int QQmlError::line() const { if (d) - return qmlConvertSourceCoordinate<quint32, int>(d->line); + return d->line; return -1; } @@ -196,7 +199,7 @@ void QQmlError::setLine(int line) { if (!d) d = new QQmlErrorPrivate; - d->line = qmlConvertSourceCoordinate<int, quint32>(line); + d->line = line; } /*! @@ -205,7 +208,7 @@ void QQmlError::setLine(int line) int QQmlError::column() const { if (d) - return qmlConvertSourceCoordinate<quint32, int>(d->column); + return d->column; return -1; } @@ -216,7 +219,7 @@ void QQmlError::setColumn(int column) { if (!d) d = new QQmlErrorPrivate; - d->column = qmlConvertSourceCoordinate<int, quint32>(column); + d->column = column; } /*! |