diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2018-02-15 15:41:37 +0100 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2018-02-19 16:27:59 +0000 |
commit | b8dbe476f01a38afc921f9693d89f3c72396651a (patch) | |
tree | cb6adbd83195adbff53cb5f2e38d9a6903626c0d /src/imports/layouts | |
parent | 047f161b1a706e81034ccd8d4700a3126c16dfe4 (diff) |
Only warn about actual *anchors* in layout children
Do not warn if they don't actually pose a problem, such as having just
anchors.margins: 42
in a layout child item (as demonstrated by the test)
Change-Id: I01e4515e91d7d0df3ae6bf9061cebe5c51802998
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/imports/layouts')
-rw-r--r-- | src/imports/layouts/qquicklayout.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/imports/layouts/qquicklayout.cpp b/src/imports/layouts/qquicklayout.cpp index 7d51ec3ca9..c1e34813c6 100644 --- a/src/imports/layouts/qquicklayout.cpp +++ b/src/imports/layouts/qquicklayout.cpp @@ -771,7 +771,8 @@ bool QQuickLayout::shouldIgnoreItem(QQuickItem *child, QQuickLayoutAttached *&in void QQuickLayout::checkAnchors(QQuickItem *item) const { - if (QQuickItemPrivate::get(item)->_anchors) + QQuickAnchors *anchors = QQuickItemPrivate::get(item)->_anchors; + if (anchors && anchors->activeDirections()) qmlWarning(item) << "Detected anchors on an item that is part of a layout. This is undefined behavior."; } |