1 | // Copyright (C) 2021 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #include "geometrytestutils_p.h" |
5 | |
6 | #include <QQuickItem> |
7 | |
8 | QT_BEGIN_NAMESPACE |
9 | |
10 | QSizeChangeListener::QSizeChangeListener(QQuickItem *item) : |
11 | item(item) |
12 | { |
13 | connect(sender: item, signal: &QQuickItem::widthChanged, context: this, slot: &QSizeChangeListener::onSizeChanged); |
14 | connect(sender: item, signal: &QQuickItem::heightChanged, context: this, slot: &QSizeChangeListener::onSizeChanged); |
15 | } |
16 | |
17 | void QSizeChangeListener::onSizeChanged() |
18 | { |
19 | append(t: QSize(item->width(), item->height())); |
20 | } |
21 | |
22 | QT_END_NAMESPACE |
23 | |
24 | #include "moc_geometrytestutils_p.cpp" |
25 |