12#pragma qt_class(QtTestGui)
15#include <QtTest/qtestassert.h>
16#include <QtTest/qtest.h>
17#include <QtTest/qtestevent.h>
18#include <QtTest/qtestmouse.h>
19#include <QtTest/qtesttouch.h>
20#include <QtTest/qtestwheel.h>
21#include <QtTest/qtestkeyboard.h>
23#include <QtGui/qcolor.h>
24#include <QtGui/qpixmap.h>
25#include <QtGui/qimage.h>
26#if QT_CONFIG(shortcut)
27#include <QtGui/qkeysequence.h>
29#include <QtGui/qregion.h>
30#include <QtGui/qvector2d.h>
31#include <QtGui/qvector3d.h>
32#include <QtGui/qvector4d.h>
33#include <QtGui/qicon.h>
37#pragma qt_no_master_include
59 const auto rects = region.
begin();
65 for (
int i = 0;
i < rectCount; ++
i) {
84#if !defined(QT_NO_VECTOR2D) || defined(Q_QDOC)
92#if !defined(QT_NO_VECTOR3D) || defined(Q_QDOC)
100#if !defined(QT_NO_VECTOR4D) || defined(Q_QDOC)
110#if QT_CONFIG(shortcut)
121 return qCompare(*
reinterpret_cast<void *
const *
>(&
t1),
130 const bool t1Null =
t1.isNull();
131 const bool t2Null =
t2.isNull();
132 if (t1Null != t2Null) {
133 qsnprintf(msg, 1024,
"Compared QImages differ.\n"
134 " Actual (%s).isNull(): %d\n"
135 " Expected (%s).isNull(): %d", actual, t1Null,
expected, t2Null);
138 if (t1Null && t2Null)
141 qsnprintf(msg, 1024,
"Compared QImages differ in device pixel ratio.\n"
143 " Expected (%s): %g",
144 actual,
t1.devicePixelRatio(),
148 if (
t1.width() !=
t2.width() ||
t1.height() !=
t2.height()) {
149 qsnprintf(msg, 1024,
"Compared QImages differ in size.\n"
150 " Actual (%s): %dx%d\n"
151 " Expected (%s): %dx%d",
152 actual,
t1.width(),
t1.height(),
156 if (
t1.format() !=
t2.format()) {
157 qsnprintf(msg, 1024,
"Compared QImages differ in format.\n"
159 " Expected (%s): %d",
172 const bool t1Null =
t1.isNull();
173 const bool t2Null =
t2.isNull();
174 if (t1Null != t2Null) {
175 qsnprintf(msg, 1024,
"Compared QPixmaps differ.\n"
176 " Actual (%s).isNull(): %d\n"
177 " Expected (%s).isNull(): %d", actual, t1Null,
expected, t2Null);
180 if (t1Null && t2Null)
183 qsnprintf(msg, 1024,
"Compared QPixmaps differ in device pixel ratio.\n"
185 " Expected (%s): %g",
186 actual,
t1.devicePixelRatio(),
190 if (
t1.width() !=
t2.width() ||
t1.height() !=
t2.height()) {
191 qsnprintf(msg, 1024,
"Compared QPixmaps differ in size.\n"
192 " Actual (%s): %dx%d\n"
193 " Expected (%s): %dx%d",
194 actual,
t1.width(),
t1.height(),
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
The QColor class provides colors based on RGB, HSV or CMYK values.
The QIcon class provides scalable icons in different modes and states.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
QString toString(SequenceFormat format=PortableText) const
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
The QRegion class specifies a clip region for a painter.
int rectCount() const noexcept
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
const_iterator begin() const noexcept
The QVector2D class represents a vector or vertex in 2D space.
The QVector3D class represents a vector or vertex in 3D space.
The QVector4D class represents a vector or vertex in 4D space.
Combined button and popup list for selecting options.
char * toString(const MyPoint &point)
bool qCompare(QString const &t1, QLatin1StringView const &t2, const char *actual, const char *expected, const char *file, int line)
Q_TESTLIB_EXPORT bool compare_helper(bool success, const char *failureMsg, const void *actualPtr, const void *expectedPtr, const char *(*actualFormatter)(const void *), const char *(*expectedFormatter)(const void *), const char *actual, const char *expected, const char *file, int line)
Q_CORE_EXPORT int qsnprintf(char *str, size_t n, const char *fmt,...)
Q_CORE_EXPORT char * qstrdup(const char *)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
[4]
#define QTEST_ASSERT(cond)