VTK  9.1.0
QTestApp.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: QTestApp.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*-------------------------------------------------------------------------
16 Copyright 2008 Sandia Corporation.
17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18 the U.S. Government retains certain rights in this software.
19-------------------------------------------------------------------------*/
20
21#ifndef QTestApp_h
22#define QTestApp_h
23
24#include <QApplication>
25#include <QByteArray>
26#include <QVector>
27
29{
30public:
31 QTestApp(int _argc, char** _argv);
33
34 static int exec();
35
36 static void messageHandler(
37 QtMsgType type, const QMessageLogContext& context, const QString& message);
38
39 static void delay(int ms);
40
41 static void simulateEvent(QWidget* w, QEvent* e);
42
43 static void keyUp(QWidget* w, Qt::Key key, Qt::KeyboardModifiers mod, int ms);
44
45 static void keyDown(QWidget* w, Qt::Key key, Qt::KeyboardModifiers mod, int ms);
46
47 static void keyClick(QWidget* w, Qt::Key key, Qt::KeyboardModifiers mod, int ms);
48
49 static void mouseDown(
50 QWidget* w, QPoint pos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms);
51
52 static void mouseUp(
53 QWidget* w, QPoint pos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms);
54
55 static void mouseMove(
56 QWidget* w, QPoint pos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms);
57
58 static void mouseClick(
59 QWidget* w, QPoint pos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms);
60
61private:
62 QApplication* App;
63 static int Error;
64 QList<QByteArray> Argv;
65 QVector<char*> Argvp;
66 int Argc;
67};
68
69#endif
static void simulateEvent(QWidget *w, QEvent *e)
static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message)
static void mouseClick(QWidget *w, QPoint pos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms)
static void delay(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 void mouseMove(QWidget *w, QPoint pos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms)
static void mouseUp(QWidget *w, QPoint pos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms)
static int exec()
static void mouseDown(QWidget *w, QPoint pos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms)