From 604e379338e7c9e17c929063148754a30077988c Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 3 Jan 2019 14:33:30 +0100 Subject: Improve logging of nested arrays Nested arrays should be printed with nested '[' and ']', rather than flattened. [ChangeLog][QML] Nested arrays are not flattened anymore when printed through console.log() and friends. Change-Id: Ic27e58047fd78bc146e1179585fd0cb2c60a1144 Fixes: QTBUG-71931 Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmlconsole/data/logging.qml | 1 + tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'tests/auto/qml/qqmlconsole') diff --git a/tests/auto/qml/qqmlconsole/data/logging.qml b/tests/auto/qml/qqmlconsole/data/logging.qml index 8ed2dd73a1..1f929d311b 100644 --- a/tests/auto/qml/qqmlconsole/data/logging.qml +++ b/tests/auto/qml/qqmlconsole/data/logging.qml @@ -69,6 +69,7 @@ QtObject { console.log(contextStringListProperty); console.log(customObject); + console.log([[1,2,3,[2,2,2,2],4],[5,6,7,8]]); try { console.log(exception); diff --git a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp index f26eaa0817..b157314071 100644 --- a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp +++ b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp @@ -93,6 +93,7 @@ void tst_qqmlconsole::logging() QTest::ignoreMessage(QtDebugMsg, "1 [ping,pong] [object Object] 2"); QTest::ignoreMessage(QtDebugMsg, "[Hello,World]"); QTest::ignoreMessage(QtDebugMsg, "QVariant(CustomObject, MY OBJECT)"); + QTest::ignoreMessage(QtDebugMsg, "[[1,2,3,[2,2,2,2],4],[5,6,7,8]]"); QScopedPointer loggingContext(new QQmlContext(engine.rootContext())); QStringList stringList; stringList << QStringLiteral("Hello") << QStringLiteral("World"); -- cgit v1.2.3