From 8990cc9e260ba1685cad23a68ba2ee672ea68a0f Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 12 Jan 2017 15:10:03 +0100 Subject: QQuickGridLayout: Use qmlWarning to give extra context to warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We now have file & line number information pointing us to the location of the faulty child. Also take the effort to split the message into two, so it's clear which property is faulty (and which the value is representing). Change-Id: I8e515feeaf8fa1decf8aaf7adf0a02cce7aec0ea Reviewed-by: Jan Arve Sæther --- src/imports/layouts/qquicklinearlayout.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/imports/layouts/qquicklinearlayout.cpp b/src/imports/layouts/qquicklinearlayout.cpp index 40aa8818a6..887b9b1fa1 100644 --- a/src/imports/layouts/qquicklinearlayout.cpp +++ b/src/imports/layouts/qquicklinearlayout.cpp @@ -41,6 +41,7 @@ #include "qquickgridlayoutengine_p.h" #include "qquicklayoutstyleinfo_p.h" #include +#include #include "qdebug.h" #include @@ -675,12 +676,14 @@ void QQuickGridLayout::insertLayoutItems() } rowSpan = info->rowSpan(); columnSpan = info->columnSpan(); - if (columnSpan < 1 || rowSpan < 1) { - qWarning("QQuickGridLayoutBase::addItem: invalid row span/column span: %d", - rowSpan < 1 ? rowSpan : columnSpan); + if (columnSpan < 1) { + qmlWarning(child) << "Layout: invalid column span: " << columnSpan; return; - } + } else if (rowSpan < 1) { + qmlWarning(child) << "Layout: invalid row span: " << rowSpan; + return; + } alignment = info->alignment(); } -- cgit v1.2.3