VTK
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 <QVector>
26 #include <QByteArray>
27 
28 class QTestApp
29 {
30 public:
31  QTestApp(int _argc, char** _argv);
32  ~QTestApp();
33 
34  static int exec();
35 
36  static void messageHandler(QtMsgType type,
37  const QMessageLogContext & context,
38  const QString & message);
39 
40  static void delay(int ms);
41 
42  static void simulateEvent(QWidget* w, QEvent* e);
43 
44  static void keyUp(QWidget* w, Qt::Key key, Qt::KeyboardModifiers mod, int ms);
45 
46  static void keyDown(QWidget* w, Qt::Key key, Qt::KeyboardModifiers mod, int ms);
47 
48  static void keyClick(QWidget* w, Qt::Key key, Qt::KeyboardModifiers mod, int ms);
49 
50  static void mouseDown(QWidget* w, QPoint pos, Qt::MouseButton btn,
51  Qt::KeyboardModifiers mod, int ms);
52 
53  static void mouseUp(QWidget* w, QPoint pos, Qt::MouseButton btn,
54  Qt::KeyboardModifiers mod, int ms);
55 
56  static void mouseMove(QWidget* w, QPoint pos, Qt::MouseButton btn,
57  Qt::KeyboardModifiers mod, int ms);
58 
59  static void mouseClick(QWidget* w, QPoint pos, Qt::MouseButton btn,
60  Qt::KeyboardModifiers mod, int ms);
61 
62 private:
63  QApplication* App;
64  static int Error;
65  QList<QByteArray> Argv;
66  QVector<char*> Argvp;
67  int Argc;
68 };
69 
70 #endif
71 
static void delay(int ms)
static void mouseMove(QWidget *w, QPoint pos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms)
static void simulateEvent(QWidget *w, QEvent *e)
static void keyDown(QWidget *w, Qt::Key key, Qt::KeyboardModifiers mod, int ms)
static void keyUp(QWidget *w, Qt::Key key, Qt::KeyboardModifiers mod, int ms)
static int exec()
QTestApp(int _argc, char **_argv)
static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message)
static void mouseDown(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 void keyClick(QWidget *w, Qt::Key key, Qt::KeyboardModifiers mod, int ms)
static void mouseClick(QWidget *w, QPoint pos, Qt::MouseButton btn, Qt::KeyboardModifiers mod, int ms)