summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-03-20 13:28:43 +0100
committerLiang Qi <liang.qi@qt.io>2019-03-20 13:29:23 +0100
commitda6c83745fad37229f879d6e0b4fc74c114d5c2b (patch)
tree9f2d17663e77e9682fe158f88c001827c781ec9a
parent6eb826d3cd94ab6cbeb3ac6f615097905ac00930 (diff)
parent30616088b98b4f95f85993c069c8086d36151caa (diff)
downloadqttools-da6c83745fad37229f879d6e0b4fc74c114d5c2b.tar.gz
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/qdoc/configure.pri Change-Id: Iffd359fb2fa1480ea08253ef85bf2beff3ba188d
-rw-r--r--dist/changes-5.12.224
-rw-r--r--src/designer/src/lib/uilib/abstractformbuilder.cpp34
-rw-r--r--src/linguist/lupdate/qdeclarative.cpp7
-rw-r--r--src/qdoc/jscodemarker.cpp4
-rw-r--r--src/qdoc/qmlcodemarker.cpp4
-rw-r--r--src/qdoc/qmlcodeparser.cpp4
-rw-r--r--src/qdoc/qmlmarkupvisitor.cpp11
-rw-r--r--src/qdoc/qmlmarkupvisitor.h3
-rw-r--r--src/qdoc/qmlvisitor.cpp11
-rw-r--r--src/qdoc/qmlvisitor.h4
-rw-r--r--src/qtdiag/qtdiag.cpp14
11 files changed, 99 insertions, 21 deletions
diff --git a/dist/changes-5.12.2 b/dist/changes-5.12.2
new file mode 100644
index 000000000..e83f60081
--- /dev/null
+++ b/dist/changes-5.12.2
@@ -0,0 +1,24 @@
+Qt 5.12.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.12.0 through 5.12.1.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.12 series is binary compatible with the 5.11.x series.
+Applications compiled for 5.11 will continue to run with 5.12.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* lupdate *
+****************************************************************************
+
+ - [QTBUG-42736] Added support for parsing C++11 raw string literals
diff --git a/src/designer/src/lib/uilib/abstractformbuilder.cpp b/src/designer/src/lib/uilib/abstractformbuilder.cpp
index 1511d709c..683335432 100644
--- a/src/designer/src/lib/uilib/abstractformbuilder.cpp
+++ b/src/designer/src/lib/uilib/abstractformbuilder.cpp
@@ -2088,14 +2088,15 @@ void QAbstractFormBuilder::saveItemViewExtraInfo(const QAbstractItemView *itemVi
//
// Special handling for qtableview/qtreeview fake header attributes
//
- static const QStringList realPropertyNames =
- (QStringList() << QStringLiteral("visible")
- << QStringLiteral("cascadingSectionResizes")
- << QStringLiteral("defaultSectionSize")
- << QStringLiteral("highlightSections")
- << QStringLiteral("minimumSectionSize")
- << QStringLiteral("showSortIndicator")
- << QStringLiteral("stretchLastSection"));
+ static const QLatin1String realPropertyNames[] = {
+ QLatin1String("visible"),
+ QLatin1String("cascadingSectionResizes"),
+ QLatin1String("minimumSectionSize"), // before defaultSectionSize
+ QLatin1String("defaultSectionSize"),
+ QLatin1String("highlightSections"),
+ QLatin1String("showSortIndicator"),
+ QLatin1String("stretchLastSection"),
+ };
if (const QTreeView *treeView = qobject_cast<const QTreeView*>(itemView)) {
auto viewProperties = ui_widget->elementAttribute();
@@ -2465,14 +2466,15 @@ void QAbstractFormBuilder::loadItemViewExtraInfo(DomWidget *ui_widget, QAbstract
//
// Special handling for qtableview/qtreeview fake header attributes
//
- static const QStringList realPropertyNames =
- (QStringList() << QStringLiteral("visible")
- << QStringLiteral("cascadingSectionResizes")
- << QStringLiteral("defaultSectionSize")
- << QStringLiteral("highlightSections")
- << QStringLiteral("minimumSectionSize")
- << QStringLiteral("showSortIndicator")
- << QStringLiteral("stretchLastSection"));
+ static const QLatin1String realPropertyNames[] = {
+ QLatin1String("visible"),
+ QLatin1String("cascadingSectionResizes"),
+ QLatin1String("minimumSectionSize"), // before defaultSectionSize
+ QLatin1String("defaultSectionSize"),
+ QLatin1String("highlightSections"),
+ QLatin1String("showSortIndicator"),
+ QLatin1String("stretchLastSection"),
+ };
if (QTreeView *treeView = qobject_cast<QTreeView*>(itemView)) {
const auto &allAttributes = ui_widget->elementAttribute();
diff --git a/src/linguist/lupdate/qdeclarative.cpp b/src/linguist/lupdate/qdeclarative.cpp
index 40af15566..0938b86e8 100644
--- a/src/linguist/lupdate/qdeclarative.cpp
+++ b/src/linguist/lupdate/qdeclarative.cpp
@@ -221,6 +221,13 @@ private:
return std::cerr << qPrintable(m_fileName) << ':' << line << ": ";
}
+ void throwRecursionDepthError()
+ {
+ std::cerr << qPrintable(m_fileName) << ": "
+ << qPrintable(LU::tr("Maximum statement or expression depth exceeded"));
+ }
+
+
void processComments(quint32 offset, bool flush = false);
void processComment(const AST::SourceLocation &loc);
void consumeComment();
diff --git a/src/qdoc/jscodemarker.cpp b/src/qdoc/jscodemarker.cpp
index f283ab485..575ffbb58 100644
--- a/src/qdoc/jscodemarker.cpp
+++ b/src/qdoc/jscodemarker.cpp
@@ -130,6 +130,10 @@ QString JsCodeMarker::addMarkUp(const QString &code,
// unhandled source text can be output.
QmlMarkupVisitor visitor(code, pragmas, &engine);
QQmlJS::AST::Node::accept(ast, &visitor);
+ if (visitor.hasError()) {
+ location.warning(location.fileName() +
+ tr("Unable to analyze JavaScript. The output is incomplete."));
+ }
output = visitor.markedUpCode();
} else {
location.warning(location.fileName() +
diff --git a/src/qdoc/qmlcodemarker.cpp b/src/qdoc/qmlcodemarker.cpp
index 22c8c3edd..ce074360b 100644
--- a/src/qdoc/qmlcodemarker.cpp
+++ b/src/qdoc/qmlcodemarker.cpp
@@ -186,6 +186,10 @@ QString QmlCodeMarker::addMarkUp(const QString &code,
// unhandled source text can be output.
QmlMarkupVisitor visitor(code, pragmas, &engine);
QQmlJS::AST::Node::accept(ast, &visitor);
+ if (visitor.hasError()) {
+ location.warning(location.fileName() +
+ tr("Unable to analyze QML snippet. The output is incomplete."));
+ }
output = visitor.markedUpCode();
} else {
location.warning(tr("Unable to parse QML snippet: \"%1\" at line %2, column %3").arg(
diff --git a/src/qdoc/qmlcodeparser.cpp b/src/qdoc/qmlcodeparser.cpp
index cbb649b48..b19c43bcb 100644
--- a/src/qdoc/qmlcodeparser.cpp
+++ b/src/qdoc/qmlcodeparser.cpp
@@ -142,6 +142,10 @@ void QmlCodeParser::parseSourceFile(const Location& location, const QString& fil
topicCommands() + commonMetaCommands(),
topicCommands());
QQmlJS::AST::Node::accept(ast, &visitor);
+ if (visitor.hasError()) {
+ qDebug().nospace() << qPrintable(filePath) << ": Could not analyze QML file. "
+ << "The output is incomplete.";
+ }
}
foreach (const QQmlJS::DiagnosticMessage &msg, parser->diagnosticMessages()) {
qDebug().nospace() << qPrintable(filePath) << ':' << msg.loc.startLine
diff --git a/src/qdoc/qmlmarkupvisitor.cpp b/src/qdoc/qmlmarkupvisitor.cpp
index 7fd6e7c28..6d0f2470b 100644
--- a/src/qdoc/qmlmarkupvisitor.cpp
+++ b/src/qdoc/qmlmarkupvisitor.cpp
@@ -115,6 +115,11 @@ QString QmlMarkupVisitor::markedUpCode()
return output;
}
+bool QmlMarkupVisitor::hasError() const
+{
+ return hasRecursionDepthError;
+}
+
void QmlMarkupVisitor::addExtra(quint32 start, quint32 finish)
{
if (extraIndex >= extraLocations.length()) {
@@ -804,6 +809,12 @@ bool QmlMarkupVisitor::visit(QQmlJS::AST::UiObjectDefinition *definition)
QQmlJS::AST::Node::accept(definition->initializer, this);
return false;
}
+
+void QmlMarkupVisitor::throwRecursionDepthError()
+{
+ hasRecursionDepthError = true;
+}
+
#endif
QT_END_NAMESPACE
diff --git a/src/qdoc/qmlmarkupvisitor.h b/src/qdoc/qmlmarkupvisitor.h
index e01bf0e5d..d369454ff 100644
--- a/src/qdoc/qmlmarkupvisitor.h
+++ b/src/qdoc/qmlmarkupvisitor.h
@@ -55,6 +55,7 @@ public:
virtual ~QmlMarkupVisitor();
QString markedUpCode();
+ bool hasError() const;
bool visit(QQmlJS::AST::UiImport *) override;
void endVisit(QQmlJS::AST::UiImport *) override;
@@ -152,6 +153,7 @@ private:
void addVerbatim(QQmlJS::AST::SourceLocation first,
QQmlJS::AST::SourceLocation last = QQmlJS::AST::SourceLocation());
QString sourceText(QQmlJS::AST::SourceLocation &location);
+ void throwRecursionDepthError();
QQmlJS::Engine *engine;
QVector<ExtraType> extraTypes;
@@ -160,6 +162,7 @@ private:
QString output;
quint32 cursor;
int extraIndex;
+ bool hasRecursionDepthError = false;
};
Q_DECLARE_TYPEINFO(QmlMarkupVisitor::ExtraType, Q_PRIMITIVE_TYPE);
#endif
diff --git a/src/qdoc/qmlvisitor.cpp b/src/qdoc/qmlvisitor.cpp
index 901cde98a..c52081847 100644
--- a/src/qdoc/qmlvisitor.cpp
+++ b/src/qdoc/qmlvisitor.cpp
@@ -792,6 +792,17 @@ void QmlDocVisitor::endVisit(QQmlJS::AST::UiQualifiedId* )
{
// nothing.
}
+
+void QmlDocVisitor::throwRecursionDepthError()
+{
+ hasRecursionDepthError = true;
+}
+
+bool QmlDocVisitor::hasError() const
+{
+ return hasRecursionDepthError;
+}
+
#endif
QT_END_NAMESPACE
diff --git a/src/qdoc/qmlvisitor.h b/src/qdoc/qmlvisitor.h
index 321819457..6e73171dc 100644
--- a/src/qdoc/qmlvisitor.h
+++ b/src/qdoc/qmlvisitor.h
@@ -92,6 +92,9 @@ public:
bool visit(QQmlJS::AST::UiQualifiedId *) override;
void endVisit(QQmlJS::AST::UiQualifiedId *) override;
+ void throwRecursionDepthError();
+ bool hasError() const;
+
private:
QString getFullyQualifiedId(QQmlJS::AST::UiQualifiedId *id);
QQmlJS::AST::SourceLocation precedingComment(quint32 offset) const;
@@ -112,6 +115,7 @@ private:
QSet<QString> topics_;
QSet<quint32> usedComments;
Aggregate *current;
+ bool hasRecursionDepthError = false;
};
#endif
diff --git a/src/qtdiag/qtdiag.cpp b/src/qtdiag/qtdiag.cpp
index 24aa273b4..448b3d6cb 100644
--- a/src/qtdiag/qtdiag.cpp
+++ b/src/qtdiag/qtdiag.cpp
@@ -679,11 +679,15 @@ QString qtDiag(unsigned flags)
// On Windows, this will provide addition GPU info similar to the output of dxdiag.
if (const QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface()) {
- const QVariant gpuInfoV = ni->property("gpu");
- if (gpuInfoV.type() == QVariant::Map) {
- const QString description = gpuInfoV.toMap().value(QStringLiteral("printable")).toString();
- if (!description.isEmpty())
- str << "\nGPU:\n" << description;
+ const QVariant gpuInfoV = ni->property("gpuList");
+ if (gpuInfoV.type() == QVariant::List) {
+ const auto gpuList = gpuInfoV.toList();
+ for (int i = 0; i < gpuList.size(); ++i) {
+ const QString description =
+ gpuList.at(i).toMap().value(QStringLiteral("printable")).toString();
+ if (!description.isEmpty())
+ str << "\nGPU #" << (i + 1) << ":\n" << description << '\n';
+ }
}
}
return result;