From 628d3eeb4b91ef0159a87f3add5d97a77af5fec6 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether <jan-arve.saether@digia.com> Date: Wed, 10 Apr 2013 10:09:22 +0200 Subject: [PATCH] Remove a function that doesn't serve any purpose anymore. setupItemLayout was supposed to do initialization on each item before it got added to the layout, but all it did was to add the attached property to the item, which is really not needed anymore. The layout code does not work under the assumption that each item has the attached property anyway, so we can remove it. (And in addition avoid some potential allocations) Change-Id: I6d7e3e5b13531dfeaceef495de144dcf87d38cc4 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> --- src/layouts/qquicklayout.cpp | 6 ------ src/layouts/qquicklayout_p.h | 2 -- src/layouts/qquicklinearlayout.cpp | 4 ---- 3 files changed, 12 deletions(-) diff --git a/src/layouts/qquicklayout.cpp b/src/layouts/qquicklayout.cpp index 68e6b6b3e..7f80fa8c2 100644 --- a/src/layouts/qquicklayout.cpp +++ b/src/layouts/qquicklayout.cpp @@ -198,12 +198,6 @@ QQuickLayout::~QQuickLayout() } -void QQuickLayout::setupItemLayout(QQuickItem *item) -{ - //### not needed anymore, since these are deducted from hierarcy? - qmlAttachedPropertiesObject<QQuickLayout>(item); -} - QQuickLayoutAttached *QQuickLayout::qmlAttachedProperties(QObject *object) { return new QQuickLayoutAttached(object); diff --git a/src/layouts/qquicklayout_p.h b/src/layouts/qquicklayout_p.h index a13d79e3d..26c063463 100644 --- a/src/layouts/qquicklayout_p.h +++ b/src/layouts/qquicklayout_p.h @@ -81,8 +81,6 @@ public: protected: bool event(QEvent *e); virtual void rearrange(const QSizeF &); - void setupItemLayout(QQuickItem *item); - enum Orientation { Vertical = 0, diff --git a/src/layouts/qquicklinearlayout.cpp b/src/layouts/qquicklinearlayout.cpp index 4fe50b4de..c452e4fdc 100644 --- a/src/layouts/qquicklinearlayout.cpp +++ b/src/layouts/qquicklinearlayout.cpp @@ -498,8 +498,6 @@ void QQuickGridLayout::insertLayoutItems() QQuickGridLayoutItem *layoutItem = new QQuickGridLayoutItem(child, row, column, rowSpan, columnSpan); d->engine.insertItem(layoutItem, -1); - - setupItemLayout(child); } } } @@ -550,8 +548,6 @@ void QQuickLinearLayout::insertLayoutItems() qSwap(gridRow, gridColumn); QQuickGridLayoutItem *layoutItem = new QQuickGridLayoutItem(child, gridRow, gridColumn, 1, 1, 0); d->engine.insertItem(layoutItem, index); - - setupItemLayout(child); } } } -- GitLab