From d62302a3067f45dab6e8803a244c38149849cbf5 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 18 May 2023 14:37:49 +0800 Subject: [PATCH] QQuickLayout: improve polish loop warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Print the layout that caused (or detected) the loop to make finding it easier. Until now it was only possible to find the item by debugging Qt, which is tedious for users. - Replace the module prefix ("Qt Quick Layouts") with a simpler "Layout" prefix, as qmlWarning(this) already ensures that the type name is printed at the beginning of the warning. Pick-to: 6.5 6.6 Change-Id: Ief801cad21958d7a8da406452f2918889f90658f Reviewed-by: Jan Arve Sæther --- src/quicklayouts/qquicklayout.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/quicklayouts/qquicklayout.cpp b/src/quicklayouts/qquicklayout.cpp index 8510f92a6f..5a6b30ff38 100644 --- a/src/quicklayouts/qquicklayout.cpp +++ b/src/quicklayouts/qquicklayout.cpp @@ -845,7 +845,8 @@ void QQuickLayout::invalidate(QQuickItem * /*childItem*/) qCDebug(lcQuickLayouts) << "QQuickLayout::invalidate(), polish()"; polish(); } else { - qmlWarning(this) << "Qt Quick Layouts: Polish loop detected. Aborting after two iterations."; + qmlWarning(this).nospace() << "Layout polish loop detected for " << this + << ". Aborting after two iterations."; } } }