Loading...
Searching...
No Matches
testFramework.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_WIDGETS_TESTFRAMEWORK_H
#define BALL_VIEW_WIDGETS_TESTFRAMEWORK_H
#ifndef BALL_VIEW_WIDGETS_DOCKWIDGET_H
# include <BALL/VIEW/WIDGETS/dockWidget.h>
#endif
#ifndef BALL_SYSTEM_FILE_H
# include <BALL/SYSTEM/file.h>
#endif
#ifndef BALL_SYSTEM_TIMER_H
# include <BALL/SYSTEM/timer.h>
#endif
#include <QtCore/QThread>
class QAction;
namespace BALL
{
namespace VIEW
{
class BALL_VIEW_EXPORT TestFramework
: public QWidget,
public ModularWidget
{
Q_OBJECT
class MyMouseEvent
: public QMouseEvent
{
public:
MyMouseEvent(Type type, const QPoint & position, Qt::MouseButton button,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
: QMouseEvent(type, position, button, buttons, modifiers) {}
};
class MyEventThread
: public QThread
{
public:
MyEventThread();
virtual void run();
TestFramework* tf;
MainControl* mc;
};
friend class MyEventThread;
public:
BALL_EMBEDDABLE(TestFramework,DockWidget)
TestFramework(QWidget *parent = 0, const char *name = 0);
virtual ~TestFramework();
//
virtual void initializeWidget(MainControl& main_control);
void setFilename(const String& filename);
void checkMenu(MainControl& main_control);
virtual bool canHandle(const String& fileformat) const;
virtual bool openFile(const String& filename);
public Q_SLOTS:
void startTest();
void stopTest();
void runTest();
void abortTest();
void saveFile();
void loadFile();
virtual bool eventFilter(QObject*, QEvent* e);
virtual void timeOut();
void switchRecordMove();
protected:
virtual bool event(QEvent* e);
void storeEvent(QEvent& e);
void processEvent_();
QAction* start_recording, *stop_recording, *run_test, *abort_test,
*save_file, *load_file, *switch_move;
QAction* action_;
File outfile_;
File infile_;
String filename_;
Timer timer_, runtime_;
list<String>lines_;
QWidget* widget_, *last_widget_;
float time_;
bool event_busy_;
Index x_, y_;
int modifiers_, type_, our_type_, button_, buttons_;
bool test_running_, recording_;
String last_event_string_, last_names_, shortcut_;
String python_line_;
String expected_result_;
MyEventThread thread_;
Size errors_;
QEvent* last_event_;
bool is_command_line_;
float max_run_time_;
Position line_nr_;
};
} } // namespaces
#endif // BALL_VIEW_WIDGETS_TESTFRAMEWORK_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::File
Definition file.h:136
BALL::String
Definition string.h:57
BALL::Timer
Definition timer.h:31
BALL::VIEW::DockWidget
Definition dockWidget.h:28
BALL::VIEW::MainControl
Definition mainControl.h:118
BALL::VIEW::ModularWidget::ModularWidget
ModularWidget(const char *name="<ModularWidget>")
BALL::VIEW::TestFramework::last_event_
QEvent * last_event_
Definition testFramework.h:171
BALL::VIEW::TestFramework::run_test
QAction * run_test
Definition testFramework.h:151
BALL::VIEW::TestFramework::filename_
String filename_
Definition testFramework.h:157
BALL::VIEW::TestFramework::eventFilter
virtual bool eventFilter(QObject *, QEvent *e)
BALL::VIEW::TestFramework::save_file
QAction * save_file
Definition testFramework.h:152
BALL::VIEW::TestFramework::expected_result_
String expected_result_
Definition testFramework.h:168
BALL::VIEW::TestFramework::timeOut
virtual void timeOut()
BALL::VIEW::TestFramework::switch_move
QAction * switch_move
Definition testFramework.h:152
BALL::VIEW::TestFramework::processEvent_
void processEvent_()
BALL::VIEW::TestFramework::stopTest
void stopTest()
BALL::VIEW::TestFramework::initializeWidget
virtual void initializeWidget(MainControl &main_control)
BALL::VIEW::TestFramework::max_run_time_
float max_run_time_
Definition testFramework.h:173
BALL::VIEW::TestFramework::test_running_
bool test_running_
Definition testFramework.h:165
BALL::VIEW::TestFramework::abort_test
QAction * abort_test
Definition testFramework.h:151
BALL::VIEW::TestFramework::storeEvent
void storeEvent(QEvent &e)
BALL::VIEW::TestFramework::time_
float time_
Definition testFramework.h:161
BALL::VIEW::TestFramework::stop_recording
QAction * stop_recording
Definition testFramework.h:151
BALL::VIEW::TestFramework::last_widget_
QWidget * last_widget_
Definition testFramework.h:160
BALL::VIEW::TestFramework::runtime_
Timer runtime_
Definition testFramework.h:158
BALL::VIEW::TestFramework::last_event_string_
String last_event_string_
Definition testFramework.h:166
BALL::VIEW::TestFramework::timer_
Timer timer_
Definition testFramework.h:158
BALL::VIEW::TestFramework::action_
QAction * action_
Definition testFramework.h:153
BALL::VIEW::TestFramework::load_file
QAction * load_file
Definition testFramework.h:152
BALL::VIEW::TestFramework::thread_
MyEventThread thread_
Definition testFramework.h:169
BALL::VIEW::TestFramework::start_recording
QAction * start_recording
Definition testFramework.h:151
BALL::VIEW::TestFramework::buttons_
int buttons_
Definition testFramework.h:164
BALL::VIEW::TestFramework::y_
Index y_
Definition testFramework.h:163
BALL::VIEW::TestFramework::TestFramework
TestFramework(QWidget *parent=0, const char *name=0)
BALL::VIEW::TestFramework::loadFile
void loadFile()
BALL::VIEW::TestFramework::modifiers_
int modifiers_
Definition testFramework.h:164
BALL::VIEW::TestFramework::errors_
Size errors_
Definition testFramework.h:170
BALL::VIEW::TestFramework::checkMenu
void checkMenu(MainControl &main_control)
BALL::VIEW::TestFramework::openFile
virtual bool openFile(const String &filename)
BALL::VIEW::TestFramework::button_
int button_
Definition testFramework.h:164
BALL::VIEW::TestFramework::event_busy_
bool event_busy_
Definition testFramework.h:162
BALL::VIEW::TestFramework::line_nr_
Position line_nr_
Definition testFramework.h:174
BALL::VIEW::TestFramework::our_type_
int our_type_
Definition testFramework.h:164
BALL::VIEW::TestFramework::event
virtual bool event(QEvent *e)
BALL::VIEW::TestFramework::lines_
list< String > lines_
Definition testFramework.h:159
BALL::VIEW::TestFramework::runTest
void runTest()
BALL::VIEW::TestFramework::canHandle
virtual bool canHandle(const String &fileformat) const
BALL::VIEW::TestFramework::python_line_
String python_line_
Definition testFramework.h:167
BALL::VIEW::TestFramework::shortcut_
String shortcut_
Definition testFramework.h:166
BALL::VIEW::TestFramework::startTest
void startTest()
BALL::VIEW::TestFramework::last_names_
String last_names_
Definition testFramework.h:166
BALL::VIEW::TestFramework::recording_
bool recording_
Definition testFramework.h:165
BALL::VIEW::TestFramework::abortTest
void abortTest()
BALL::VIEW::TestFramework::infile_
File infile_
Definition testFramework.h:156
BALL::VIEW::TestFramework::widget_
QWidget * widget_
Definition testFramework.h:160
BALL::VIEW::TestFramework::saveFile
void saveFile()
BALL::VIEW::TestFramework::outfile_
File outfile_
Definition testFramework.h:155
BALL::VIEW::TestFramework::x_
Index x_
Definition testFramework.h:163
BALL::VIEW::TestFramework::is_command_line_
bool is_command_line_
Definition testFramework.h:172
BALL::VIEW::TestFramework::setFilename
void setFilename(const String &filename)
BALL::VIEW::TestFramework::type_
int type_
Definition testFramework.h:164
BALL::VIEW::TestFramework::switchRecordMove
void switchRecordMove()
QEvent
QMouseEvent
QObject
QThread
QWidget
dockWidget.h
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition embeddable.h:31
file.h
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105
timer.h