42 #if !defined(QTESTMOUSE_H) 47 #pragma qt_no_master_include 50 #include <QtTest/qtest_global.h> 51 #include <QtTest/qtestassert.h> 52 #include <QtTest/qtestsystem.h> 53 #include <QtTest/qtestspontaneevent.h> 55 #include <QtCore/qpoint.h> 56 #include <QtCore/qstring.h> 57 #include <QtGui/qapplication.h> 58 #include <QtGui/qevent.h> 59 #include <QtGui/qwidget.h> 72 Qt::KeyboardModifiers stateKey,
QPoint pos,
int delay=-1)
110 #ifdef QT_MAC_USE_COCOA 113 qApp->processEvents();
120 if (!
qApp->notify(widget, &me)) {
121 static const char *mouseActionNames[] =
122 {
"MousePress",
"MouseRelease",
"MouseClick",
"MouseDClick",
"MouseMove" };
150 #endif // QTESTMOUSE_H
MouseAction
This enum describes possible actions for mouse handling.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
char * data()
Returns a pointer to the data stored in the byte array.
void mouseDClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=0, QPoint pos=QPoint(), int delay=-1)
Simulates double clicking a mouse button with an optional modifier on a widget.
The QString class provides a Unicode character string.
static void setPos(int x, int y)
Moves the cursor (hot spot) to the global screen position (x, y).
void mouseClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=0, QPoint pos=QPoint(), int delay=-1)
Simulates clicking a mouse button with an optional modifier on a widget.
void mousePress(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=0, QPoint pos=QPoint(), int delay=-1)
Simulates pressing a mouse button with an optional modifier on a widget.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isNull() const
Returns true if both the x and y coordinates are set to 0, otherwise returns false.
The QMouseEvent class contains parameters that describe a mouse event.
QPoint center() const
Returns the center point of the rectangle.
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
static void qWait(int ms)
Waits for ms milliseconds.
void mouseRelease(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=0, QPoint pos=QPoint(), int delay=-1)
Simulates releasing a mouse button with an optional modifier on a widget.
Q_TESTLIB_EXPORT void qWarn(const char *message)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
#define QTEST_ASSERT(cond)
The QPoint class defines a point in the plane using integer precision.
void mouseMove(QWidget *widget, QPoint pos=QPoint(), int delay=-1)
Moves the mouse pointer to a widget.
QByteArray toAscii() const Q_REQUIRED_RESULT
Returns an 8-bit representation of the string as a QByteArray.
static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
int Q_TESTLIB_EXPORT defaultMouseDelay()
The QTest namespace contains all the functions and declarations that are related to the QTestLib tool...