Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
geometrytestutils.cpp
Go to the documentation of this file.
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
5
6#include <QQuickItem>
7
9
11 item(item)
12{
13 connect(item, &QQuickItem::widthChanged, this, &QSizeChangeListener::onSizeChanged);
14 connect(item, &QQuickItem::heightChanged, this, &QSizeChangeListener::onSizeChanged);
15}
16
17void QSizeChangeListener::onSizeChanged()
18{
19 append(QSize(item->width(), item->height()));
20}
21
23
24#include "moc_geometrytestutils_p.cpp"
void append(parameter_type t)
Definition qlist.h:441
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2823
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
void heightChanged()
void widthChanged()
qreal width
This property holds the width of this item.
Definition qquickitem.h:76
qreal height
This property holds the height of this item.
Definition qquickitem.h:77
QSizeChangeListener(QQuickItem *item)
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
QGraphicsItem * item