1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qquickitem.h"
5#include "qquickgridlayoutengine_p.h"
6#include "qquicklayout_p.h"
7
8QT_BEGIN_NAMESPACE
9
10void QQuickGridLayoutEngine::setAlignment(QQuickItem *quickItem, Qt::Alignment alignment)
11{
12 if (QQuickGridLayoutItem *item = findLayoutItem(layoutItem: quickItem)) {
13 item->setAlignment(alignment);
14 invalidate();
15 }
16}
17
18void QQuickGridLayoutEngine::setStretchFactor(QQuickItem *quickItem, int stretch,
19 Qt::Orientation orientation)
20{
21 Q_ASSERT(stretch >= -1); // -1 is reset
22 if (QGridLayoutItem *item = findLayoutItem(layoutItem: quickItem)) {
23 item->setStretchFactor(stretch, orientation);
24 invalidate();
25 }
26}
27
28QT_END_NAMESPACE
29

source code of qtdeclarative/src/quicklayouts/qquickgridlayoutengine.cpp