diff options
| author | Sami Shalayel <sami.shalayel@qt.io> | 2026-03-13 13:23:56 +0100 |
|---|---|---|
| committer | Sami Shalayel <sami.shalayel@qt.io> | 2026-03-18 20:54:16 +0100 |
| commit | 9744f25eab22f651eec829f31110745d47f4825b (patch) | |
| tree | 171f183065ed55c59425f566d20b42ecfe2aca74 | |
| parent | eb3fff930412e28e52acf503057051006523cb38 (diff) | |
tst_qmlformat: use indenting line writer if column break is in use
Amends 3bb4962254498504c135ca0243c0be5bdf6defad that uses the indenting
line writer in qmlformat but not in the qmlformat tests.
Task-number: QTBUG-140506
Change-Id: I93ce76022958bf51333d8db3ce5b42fbc295062b
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
(cherry picked from commit 56ffd68aba05155671a55fd7544fa8f47ec829dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 68aad6080966ec62fc9b455ce1cce292133dc443)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| -rw-r--r-- | tests/auto/qml/qmlformat/tst_qmlformat.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/qml/qmlformat/tst_qmlformat.cpp b/tests/auto/qml/qmlformat/tst_qmlformat.cpp index 09b88a3124..30e0e242b0 100644 --- a/tests/auto/qml/qmlformat/tst_qmlformat.cpp +++ b/tests/auto/qml/qmlformat/tst_qmlformat.cpp @@ -11,6 +11,7 @@ #include <QtQuickTestUtils/private/qmlutils_p.h> #include <QtQmlDom/private/qqmldomitem_p.h> #include <QtQmlDom/private/qqmldomlinewriter_p.h> +#include <QtQmlDom/private/qqmldomlinewriterfactory_p.h> #include <QtQmlDom/private/qqmldomoutwriter_p.h> #include <QtQmlDom/private/qqmldomtop_p.h> #include <QtQmlToolingSettings/private/qqmltoolingsettings_p.h> @@ -259,12 +260,13 @@ QString TestQmlformat::formatInMemory(const QString &fileToFormat, bool *didSucc checks = largeChecks; QTextStream res(&resultStr); - LineWriter lw([&res](QStringView s) { res << s; }, QLatin1String("*testStream*"), options); - OutWriter ow(lw); + auto lw = QQmlJS::Dom::createLineWriter([&res](QStringView s) { res << s; }, + QLatin1String("*testStream*"), options); + OutWriter ow(*lw); ow.indentNextlines = true; DomItem qmlFile = tFile.field(Fields::currentItem); writtenOut = qmlFile.writeOutForFile(ow, checks); - lw.eof(); + lw->eof(); res.flush(); } if (didSucceed) |
