diff options
Diffstat (limited to 'src/imports/layouts/qquicklayout.cpp')
-rw-r--r-- | src/imports/layouts/qquicklayout.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/imports/layouts/qquicklayout.cpp b/src/imports/layouts/qquicklayout.cpp index 7d51ec3ca9..b3a5a2cfc8 100644 --- a/src/imports/layouts/qquicklayout.cpp +++ b/src/imports/layouts/qquicklayout.cpp @@ -114,7 +114,7 @@ QQuickLayoutAttached::QQuickLayoutAttached(QObject *parent) m_isTopMarginSet(false), m_isRightMarginSet(false), m_isBottomMarginSet(false), - m_alignment(0) + m_alignment(nullptr) { } @@ -683,7 +683,7 @@ QQuickLayout *QQuickLayoutAttached::parentLayout() const } else { qmlWarning(parent()) << "Layout must be attached to Item elements"; } - return 0; + return nullptr; } QQuickItem *QQuickLayoutAttached::item() const @@ -771,8 +771,9 @@ bool QQuickLayout::shouldIgnoreItem(QQuickItem *child, QQuickLayoutAttached *&in void QQuickLayout::checkAnchors(QQuickItem *item) const { - if (QQuickItemPrivate::get(item)->_anchors) - qmlWarning(item) << "Detected anchors on an item that is part of a layout. This is undefined behavior."; + QQuickAnchors *anchors = QQuickItemPrivate::get(item)->_anchors; + if (anchors && anchors->activeDirections()) + qmlWarning(item) << "Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead."; } void QQuickLayout::itemChange(ItemChange change, const ItemChangeData &value) |