diff options
author | Robin Burchell <robin.burchell@crimson.no> | 2017-01-12 15:10:03 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2017-01-16 17:10:11 +0000 |
commit | 8990cc9e260ba1685cad23a68ba2ee672ea68a0f (patch) | |
tree | 32d0682f9ee367d5691621f3f72aba14e98ce3c2 /src/imports | |
parent | 930385acd8d30a6e0d818806ab893fdce975385f (diff) |
QQuickGridLayout: Use qmlWarning to give extra context to warnings
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 <jan-arve.saether@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/layouts/qquicklinearlayout.cpp | 11 |
1 files 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 <QtCore/private/qnumeric_p.h> +#include <QtQml/qqmlinfo.h> #include "qdebug.h" #include <limits> @@ -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(); } |