Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
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:458
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
void heightChanged()
void widthChanged()
qreal width
This property holds the width of this item.
Definition qquickitem.h:75
qreal height
This property holds the height of this item.
Definition qquickitem.h:76
QSizeChangeListener(QQuickItem *item)
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
QGraphicsItem * item