Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
geometrytestutils_p.h
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
4#ifndef QQUICKGEOMETRYTESTUTIL_P_H
5#define QQUICKGEOMETRYTESTUTIL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QObject>
19#include <QList>
20#include <QSize>
21#include <QtCore/qpoint.h>
22#include <private/qglobal_p.h>
23
25
26inline bool pointNear(QPointF a, QPointF b, qreal tol = 1.0)
27{
28 return qAbs(a.x() - b.x()) <= tol && qAbs(a.y() - b.y()) <= tol;
29}
30
31#define VERIFY_POINT_NEAR(name, actual, expected)
32 QVERIFY2(pointNear((actual), (expected)),
33 qPrintable(QStringLiteral(name "=(%1,%2) expected=(%3,%4)")
34 .arg((actual).x()).arg((actual).y())
35 .arg((expected).x()).arg((expected).y())))
36
37class QQuickItem;
38
39class QSizeChangeListener : public QObject, public QList<QSize>
40{
42public:
44private Q_SLOTS:
45 void onSizeChanged();
46private:
47 QQuickItem *item;
48};
49
50QT_END_NAMESPACE
51
52#endif // QQUICKGEOMETRYTESTUTIL_P_H
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
QT_BEGIN_NAMESPACE bool pointNear(QPointF a, QPointF b, qreal tol=1.0)
Combined button and popup list for selecting options.
connect(manager, &QNetworkAccessManager::finished, this, &MyClass::replyFinished)