4#ifndef QQUICKVISUALTESTUTILS_P_H
5#define QQUICKVISUALTESTUTILS_P_H
18#include <QtGui/private/qguiapplication_p.h>
19#include <QtGui/qpa/qplatformintegration.h>
20#include <QtQml/qqmlexpression.h>
21#include <QtQuick/private/qquickitem_p.h>
23#include <private/qmlutils_p.h>
25#include <QtCore/qpointer.h>
44 for (
int i = 0;
i < steps; ++
i) {
58 void move(
const QPoint &
pos,
int steps = 10,
int delayInMilliseconds = 1);
59 void move(
int x,
int y,
int steps = 10,
int delayInMilliseconds = 1);
83 if (
mo.cast(
item) && (objectName.
isEmpty() ||
item->objectName() == objectName)) {
90 return static_cast<T*
>(
item);
92 return static_cast<T*
>(
item);
97 return static_cast<T*
>(
item);
124 for (
int i=0;
i<indexes.size();
i++)
125 items << qobject_cast<QQuickItem*>(findItem<T>(parent, objectName, indexes[
i]));
138 template <
typename Func1>
164#if QT_CONFIG(quick_itemview)
180 return delegateItem !=
nullptr;
219 QPointer<QWindow> m_window;
220 Qt::KeyboardModifiers m_modifiers;
228#define QQUICK_VERIFY_POLISH(item) \
229 QTRY_COMPARE(QQuickItemPrivate::get(item)->polishScheduled, false)
231#define SKIP_IF_NO_WINDOW_ACTIVATION \
232if (!(QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))) \
233 QSKIP("Window activation is not supported on this platform");
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
bool isVisible() const
Returns true if the item is visible; otherwise, false is returned.
const_reference at(qsizetype i) const noexcept
void append(parameter_type t)
int senderSignalIndex() const
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
static const QPointingDevice * primaryPointingDevice(const QString &seatName=QString())
Returns the primary pointing device (the core pointer, traditionally assumed to be a mouse) on the gi...
The QQmlContext class defines a context within a QML engine.
The QQmlEngine class provides an environment for instantiating QML components.
The QQmlExpression class evaluates JavaScript in a QML context.
QVariant evaluate(bool *valueIsUndefined=nullptr)
Evaulates the expression, returning the result of the evaluation, or an invalid QVariant if the expre...
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
QList< QQuickItem * > childItems() const
Returns the children of this item.
MnemonicKeySimulator(QWindow *window)
QScopedPointer< QObject > cleanup
QQuickApplicationHelper(QQmlDataTest *testCase, const QString &testFilePath, const QVariantMap &initialProperties={}, const QStringList &qmlImportPaths={})
const char * failureMessage() const
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
void centerOnScreen(QQuickWindow *window)
QList< T * > findItems(QQuickItem *parent, const QString &objectName, bool visibleOnly=true)
void dumpTree(QQuickItem *parent, int depth=0)
bool isDelegateVisible(QQuickItem *item)
QPoint mapToWindow(const QQuickItem *item, qreal relativeX, qreal relativeY)
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)
T * findItem(QQuickItem *parent, const QString &objectName, int index=-1)
QPoint lerpPoints(const QPoint &point1, const QPoint &point2, qreal t)
void forEachStep(int steps, F &&func)
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLenum GLuint GLintptr GLsizeiptr size
[1]
QQmlContext * qmlContext(const QObject *obj)
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &errorSource, qsizetype errorPosition)
QList< QObject * > senders
QList< QByteArray > signalNames
QMetaObject::Connection connectToSignal(const typename QtPrivate::FunctionPointer< Func1 >::Object *obj, Func1 signal, Qt::ConnectionType type=Qt::AutoConnection)