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
QQuickVisualTestUtils::PointLerper Class Reference

#include <visualtestutils_p.h>

Collaboration diagram for QQuickVisualTestUtils::PointLerper:

Public Member Functions

 PointLerper (QQuickWindow *window, const QPoint &startingPosition=QPoint(0, 0), const QPointingDevice *pointingDevice=QPointingDevice::primaryPointingDevice())
void move (const QPoint &pos, int steps=10, int delayInMilliseconds=1)
void move (int x, int y, int steps=10, int delayInMilliseconds=1)

Detailed Description

Definition at line 60 of file visualtestutils_p.h.

Constructor & Destructor Documentation

◆ PointLerper()

QQuickVisualTestUtils::PointLerper::PointLerper ( QQuickWindow * window,
const QPoint & startingPosition = QPoint(0, 0),
const QPointingDevice * pointingDevice = QPointingDevice::primaryPointingDevice() )

Convenience class to linearly interpolate between two pointer move points.

PointLerper pointLerper(window);
// Lerps from {0, 0} to {15, 15}.
pointLerper.move(15, 15);
QVERIFY(parentButton->isHovered());
// Lerps from {15, 15} to {25, 25}.
pointLerper.move(25, 25);
QVERIFY(childButton->isHovered());
PointLerper(QQuickWindow *window, const QPoint &startingPosition=QPoint(0, 0), const QPointingDevice *pointingDevice=QPointingDevice::primaryPointingDevice())
#define QVERIFY(statement)
Definition qtestcase.h:64
aWidget window() -> setWindowTitle("New Window Title")
[2]

Definition at line 88 of file visualtestutils.cpp.

References PointLerper().

Referenced by PointLerper().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ move() [1/2]

void QQuickVisualTestUtils::PointLerper::move ( const QPoint & pos,
int steps = 10,
int delayInMilliseconds = 1 )

Moves from the last pos (or {0, 0} if there have been no calls to this function yet) to pos using linear interpolation over 10 (default value) steps with 1 ms (default value) delays between each step.

Definition at line 104 of file visualtestutils.cpp.

◆ move() [2/2]

void QQuickVisualTestUtils::PointLerper::move ( int x,
int y,
int steps = 10,
int delayInMilliseconds = 1 )

Definition at line 113 of file visualtestutils.cpp.

References move().

Referenced by move().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: