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/qtestkeyboard.h>
22#include <QtGui/qcolor.h>
23#include <QtGui/qpixmap.h>
24#include <QtGui/qimage.h>
25#if QT_CONFIG(shortcut)
26#include <QtGui/qkeysequence.h>
28#include <QtGui/qregion.h>
29#include <QtGui/qvector2d.h>
30#include <QtGui/qvector3d.h>
31#include <QtGui/qvector4d.h>
32#include <QtGui/qicon.h>
36#pragma qt_no_master_include
58 const auto rects = region.
begin();
64 for (
int i = 0;
i < rectCount; ++
i) {
83#if !defined(QT_NO_VECTOR2D) || defined(Q_QDOC)
91#if !defined(QT_NO_VECTOR3D) || defined(Q_QDOC)
99#if !defined(QT_NO_VECTOR4D) || defined(Q_QDOC)
109#if QT_CONFIG(shortcut)
120 return qCompare(*
reinterpret_cast<void *
const *
>(&
t1),
129 const bool t1Null =
t1.isNull();
130 const bool t2Null =
t2.isNull();
131 if (t1Null != t2Null) {
132 qsnprintf(msg, 1024,
"Compared QImages differ.\n"
133 " Actual (%s).isNull(): %d\n"
134 " Expected (%s).isNull(): %d", actual, t1Null,
expected, t2Null);
137 if (t1Null && t2Null)
140 qsnprintf(msg, 1024,
"Compared QImages differ in device pixel ratio.\n"
142 " Expected (%s): %g",
143 actual,
t1.devicePixelRatio(),
147 if (
t1.width() !=
t2.width() ||
t1.height() !=
t2.height()) {
148 qsnprintf(msg, 1024,
"Compared QImages differ in size.\n"
149 " Actual (%s): %dx%d\n"
150 " Expected (%s): %dx%d",
151 actual,
t1.width(),
t1.height(),
155 if (
t1.format() !=
t2.format()) {
156 qsnprintf(msg, 1024,
"Compared QImages differ in format.\n"
158 " Expected (%s): %d",
171 const bool t1Null =
t1.isNull();
172 const bool t2Null =
t2.isNull();
173 if (t1Null != t2Null) {
174 qsnprintf(msg, 1024,
"Compared QPixmaps differ.\n"
175 " Actual (%s).isNull(): %d\n"
176 " Expected (%s).isNull(): %d", actual, t1Null,
expected, t2Null);
179 if (t1Null && t2Null)
182 qsnprintf(msg, 1024,
"Compared QPixmaps differ in device pixel ratio.\n"
184 " Expected (%s): %g",
185 actual,
t1.devicePixelRatio(),
189 if (
t1.width() !=
t2.width() ||
t1.height() !=
t2.height()) {
190 qsnprintf(msg, 1024,
"Compared QPixmaps differ in size.\n"
191 " Actual (%s): %dx%d\n"
192 " Expected (%s): %dx%d",
193 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)
Q_TESTLIB_EXPORT bool compare_helper(bool success, const char *failureMsg, qxp::function_ref< const char *()> actualVal, qxp::function_ref< const char *()> expectedVal, const char *actual, const char *expected, const char *file, int line)
bool qCompare(QString const &t1, QLatin1StringView const &t2, 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)