VTK  9.4.20241226
QTestApp.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
4
5#ifndef QTestApp_h
6#define QTestApp_h
7
8#include <QApplication>
9#include <QByteArray>
10#include <QVector>
11
13{
14public:
15 QTestApp(int _argc, char** _argv);
17
18 static int exec();
19
20 static void messageHandler(
21 QtMsgType type, const QMessageLogContext& context, const QString& message);
22
23 static void delay(int ms);
24
25 static void simulateEvent(QWidget* w, QEvent* e);
26
27 static void keyUp(QWidget* w, Qt::Key key, Qt::KeyboardModifiers mod, int ms);
28
29 static void keyDown(QWidget* w, Qt::Key key, Qt::KeyboardModifiers mod, int ms);
30
31 static void keyClick(QWidget* w, Qt::Key key, Qt::KeyboardModifiers mod, int ms);
32
33 static void mouseDown(QWidget* w, QPoint pos, QPoint screenpos, Qt::MouseButton btn,
34 Qt::KeyboardModifiers mod, int ms);
35
36 static void mouseUp(QWidget* w, QPoint pos, QPoint screenpos, Qt::MouseButton btn,
37 Qt::KeyboardModifiers mod, int ms);
38
39 static void mouseMove(QWidget* w, QPoint pos, QPoint screenpos, Qt::MouseButton btn,
40 Qt::KeyboardModifiers mod, int ms);
41
42 static void mouseClick(QWidget* w, QPoint pos, QPoint screenpos, Qt::MouseButton btn,
43 Qt::KeyboardModifiers mod, int ms);
44
45private:
46 QApplication* App;
47 static int Error;
48 QList<QByteArray> Argv;
49 QVector<char*> Argvp;
50 int Argc;
51};
52
53#endif
static void mouseDown(QWidget *w, QPoint pos, QPoint screenpos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms)
static void mouseMove(QWidget *w, QPoint pos, QPoint screenpos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms)
static void simulateEvent(QWidget *w, QEvent *e)
static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message)
static void delay(int ms)
static void mouseUp(QWidget *w, QPoint pos, QPoint screenpos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms)
static void mouseClick(QWidget *w, QPoint pos, QPoint screenpos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms)
static void keyDown(QWidget *w, Qt::Key key, Qt::KeyboardModifiers mod, int ms)
static void keyClick(QWidget *w, Qt::Key key, Qt::KeyboardModifiers mod, int ms)
QTestApp(int _argc, char **_argv)
static void keyUp(QWidget *w, Qt::Key key, Qt::KeyboardModifiers mod, int ms)
static int exec()