6#include <QtCore/QCoreApplication>
7#include <QtCore/private/qvariantanimation_p.h>
8#include <QtCore/QDebug>
9#include <QtQuick/QQuickItem>
10#if QT_CONFIG(quick_itemview)
11#include <QtQuick/private/qquickitemview_p.h>
13#include <QtQuickTest/QtQuickTest>
14#include <QtQuickTestUtils/private/viewtestutils_p.h>
60 const QRect screenGeometry =
window->screen()->availableGeometry();
88 , mPointingDevice(pointingDevice)
111 move(
QPoint(
x,
y), steps, delayInMilliseconds);
145 const int tolerance = 5;
146 for (
int y=0;
y<
h; ++
y) {
149 for (
int x=0;
x<
w; ++
x) {
154 if ((
a & 0xff000000) != (
b & 0xff000000)
167#if QT_CONFIG(quick_itemview)
180 qWarning() <<
"failed to polish" << itemView;
186 if (index <= -1 || index >= itemView->
count()) {
187 qWarning() <<
"index" <<
index <<
"is out of bounds for" << itemView;
194 return itemView->itemAtIndex(
index);
201 for (
const auto &
path : qmlImportPaths)
208 QObject *rootObject =
component.createWithInitialProperties(initialProperties);
209 cleanup.reset(rootObject);
210 if (
component.isError() || !rootObject) {
215 window = qobject_cast<QQuickWindow*>(rootObject);
221 if (
window->isVisible()) {
230 : m_window(
window), m_modifiers(
Qt::NoModifier)
246 m_modifiers &=
~Qt::AltModifier;
273#include "moc_visualtestutils_p.cpp"
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static void setPos(int x, int y)
Moves the cursor (hot spot) of the primary screen to the global screen position (x,...
QPointF mapToScene(const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to the scene's coordinate system,...
bool isVisible() const
Returns true if the item is visible; otherwise, false is returned.
QSize size() const
Returns the size of the image, i.e.
int width() const
Returns the width of the image.
int height() const
Returns the height of the image.
Format format() const
Returns the format of the image.
const uchar * constScanLine(int) const
Returns a pointer to the pixel data at the scanline with index i.
qreal devicePixelRatio() const
Returns the device pixel ratio for the image.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
The QQmlComponent class encapsulates a QML component definition.
QUrl testFileUrl(const QString &fileName) const
static QQuickItemPrivate * get(QQuickItem *item)
Q_INVOKABLE void positionViewAtIndex(int index, int mode)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void release(Qt::Key key)
MnemonicKeySimulator(QWindow *window)
void move(const QPoint &pos, int steps=10, int delayInMilliseconds=1)
PointLerper(QQuickWindow *window, const QPointingDevice *pointingDevice=QPointingDevice::primaryPointingDevice())
QQuickApplicationHelper(QQmlDataTest *testCase, const QString &testFilePath, const QVariantMap &initialProperties={}, const QStringList &qmlImportPaths={})
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtCore\reentrant
constexpr QPoint center() const noexcept
Returns the center point of the rectangle.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
QByteArray toUtf8() const &
Q_QUICK_TEST_EXPORT bool qWaitForPolish(const QQuickItem *item, int timeout=defaultTimeout)
Q_QUICK_TEST_EXPORT bool qIsPolishScheduled(const QQuickItem *item)
void pointerMove(const QPointingDevice *dev, QQuickWindow *window, int pointId, const QPoint &p)
void centerOnScreen(QQuickWindow *window)
void dumpTree(QQuickItem *parent, int depth=0)
QPoint mapToWindow(const QQuickItem *item, qreal relativeX, qreal relativeY)
bool delegateVisible(QQuickItem *item)
QPoint mapCenterToWindow(const QQuickItem *item)
bool findViewDelegateItem(QQuickItemView *itemView, int index, T &delegateItem, FindViewDelegateItemFlags flags=FindViewDelegateItemFlag::PositionViewAtIndex)
QQuickItem * findVisibleChild(QQuickItem *parent, const QString &objectName)
void moveMouseAway(QQuickWindow *window)
bool compareImages(const QImage &ia, const QImage &ib, QString *errorMessage)
QPoint lerpPoints(const QPoint &point1, const QPoint &point2, qreal t)
void forEachStep(int steps, F &&func)
Combined button and popup list for selecting options.
Q_CORE_EXPORT void qWait(int ms)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static void simulateEvent(QWindow *window, bool press, int code, Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1)
QTextStream & hex(QTextStream &stream)
Calls QTextStream::setIntegerBase(16) on stream and returns stream.
QTextStream & showbase(QTextStream &stream)
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::ShowBase) on stream and r...
constexpr T qAbs(const T &t)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLintptr offset
GLfloat GLfloat GLfloat GLfloat h
GLsizei const GLchar *const * path
static qreal component(const QPointF &point, unsigned int i)
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
constexpr int qRed(QRgb rgb)
#define qPrintable(string)
#define QStringLiteral(str)
#define QVERIFY2(statement, description)
static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &errorSource, qsizetype errorPosition)
Q_INLINE_TEMPLATE QRect _q_interpolate(const QRect &f, const QRect &t, qreal progress)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent