Commit 65c6ebf1 authored by Clinton Stimpson's avatar Clinton Stimpson

ENH: New directory structure

parent 0154a866
PROJECT(QtTesting)
INCLUDE_DIRECTORIES(
${QtTesting_BINARY_DIR}
${QtTesting_SOURCE_DIR}
${VTK_INCLUDE_DIR}
)
# Reduce the number of dirs that get included on moc command line
# since it causes issues on Windows 2000.
GET_DIRECTORY_PROPERTY(include_dirs_tmp INCLUDE_DIRECTORIES)
SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${MOC_INCLUDE_DIRS}")
QT4_WRAP_CPP(MOC_BUILT_SOURCES
pqAbstractButtonEventTranslator.h
pqAbstractItemViewEventTranslator.h
pqAbstractSliderEventTranslator.h
pqBasicWidgetEventTranslator.h
pqComboBoxEventTranslator.h
pqDoubleSpinBoxEventTranslator.h
pqEventObserverStdout.h
pqEventObserverXML.h
pqEventPlayer.h
pqEventPlayerXML.h
pqEventTranslator.h
pqLineEditEventTranslator.h
pqMenuEventTranslator.h
pqRecordEventsDialog.h
pqSpinBoxEventTranslator.h
pqWidgetEventTranslator.h
)
SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${include_dirs_tmp}")
QT4_WRAP_UI(UI_BUILT_SOURCES
pqRecordEventsDialog.ui
)
ADD_LIBRARY(QtTesting
QtTestingExport.h
pqAbstractActivateEventPlayer.cxx
pqAbstractActivateEventPlayer.h
pqAbstractBooleanEventPlayer.cxx
pqAbstractBooleanEventPlayer.h
pqAbstractButtonEventTranslator.cxx
pqAbstractButtonEventTranslator.h
pqAbstractDoubleEventPlayer.cxx
pqAbstractDoubleEventPlayer.h
pqAbstractIntEventPlayer.cxx
pqAbstractIntEventPlayer.h
pqAbstractItemViewEventPlayer.cxx
pqAbstractItemViewEventPlayer.h
pqAbstractItemViewEventTranslator.cxx
pqAbstractItemViewEventTranslator.h
pqAbstractSliderEventTranslator.cxx
pqAbstractSliderEventTranslator.h
pqAbstractStringEventPlayer.cxx
pqAbstractStringEventPlayer.h
pqBasicWidgetEventPlayer.cxx
pqBasicWidgetEventPlayer.h
pqBasicWidgetEventTranslator.cxx
pqBasicWidgetEventTranslator.h
pqComboBoxEventTranslator.cxx
pqComboBoxEventTranslator.h
pqDoubleSpinBoxEventTranslator.cxx
pqDoubleSpinBoxEventTranslator.h
pqEventObserverStdout.cxx
pqEventObserverStdout.h
pqEventObserverXML.cxx
pqEventObserverXML.h
pqEventPlayer.cxx
pqEventPlayer.h
pqEventPlayerXML.cxx
pqEventPlayerXML.h
pqEventTranslator.cxx
pqEventTranslator.h
pqLineEditEventTranslator.cxx
pqLineEditEventTranslator.h
pqMenuEventTranslator.cxx
pqMenuEventTranslator.h
pqObjectNaming.cxx
pqObjectNaming.h
pqRecordEventsDialog.cxx
pqRecordEventsDialog.h
pqSpinBoxEventTranslator.cxx
pqSpinBoxEventTranslator.h
pqTesting.cxx
pqTesting.h
pqWidgetEventPlayer.h
pqWidgetEventTranslator.h
${MOC_BUILT_SOURCES}
${UI_BUILT_SOURCES}
)
SOURCE_GROUP("Generated" FILES
${MOC_BUILT_SOURCES}
${UI_BUILT_SOURCES}
)
TARGET_LINK_LIBRARIES(QtTesting
${QT_LIBRARIES}
${QT_XML_LIBRARIES}
)
INSTALL(TARGETS QtTesting
RUNTIME DESTINATION ${PV_INSTALL_BIN_DIR_CM24} COMPONENT Runtime
LIBRARY DESTINATION ${PV_INSTALL_LIB_DIR_CM24} COMPONENT Runtime
ARCHIVE DESTINATION ${PV_INSTALL_LIB_DIR_CM24} COMPONENT Development)
/*=========================================================================
Program: ParaView
Module: QtTestingExport.h
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.1.
See License_v1.1.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#ifndef _QtTestingExport_h
#define _QtTestingExport_h
#if defined(WIN32) && defined(PARAVIEW_BUILD_SHARED_LIBS)
# if defined(QtTesting_EXPORTS)
# define QTTESTING_EXPORT __declspec(dllexport)
# else
# define QTTESTING_EXPORT __declspec(dllimport)
# endif
#else
# define QTTESTING_EXPORT
#endif
#endif // !_QtTestingExport_h
/*=========================================================================
Program: ParaView
Module: pqAbstractActivateEventPlayer.cxx
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.1.
See License_v1.1.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#include "pqAbstractActivateEventPlayer.h"
#include "pqTesting.h"
#include <QAction>
#include <QApplication>
#include <QKeyEvent>
#include <QMenu>
#include <QMenuBar>
#include <QPushButton>
#include <QtDebug>
pqAbstractActivateEventPlayer::pqAbstractActivateEventPlayer()
{
}
bool pqAbstractActivateEventPlayer::playEvent(QObject* Object,
const QString& Command,
const QString& Arguments,
bool& Error)
{
if(Command != "activate")
return false;
if(QMenu* const object = qobject_cast<QMenu*>(Object))
{
QAction* action = NULL;
QList<QAction*> actions = object->actions();
for(int j = 0; j != actions.size() && !action; ++j)
{
if(actions[j]->objectName() == Arguments)
{
action = actions[j];
}
}
if(!action)
{
qCritical() << "couldn't find action " << Arguments;
Error = true;
return true;
}
// get a list of menus that must be navigated to
// click on the action
QObjectList menus;
for(QObject* p = object;
qobject_cast<QMenu*>(p) || qobject_cast<QMenuBar*>(p);
p = p->parent())
{
menus.push_front(p);
}
// unfold menus to make action visible
int i;
int numMenus = menus.size() - 1;
for(i=0; i < numMenus; ++i)
{
QObject* p = menus[i];
QMenu* next = qobject_cast<QMenu*>(menus[i+1]);
if(QMenuBar* menu_bar = qobject_cast<QMenuBar*>(p))
{
menu_bar->setActiveAction(next->menuAction());
while(!next->isVisible())
pqTesting::NonBlockingSleep(100);
}
else if(QMenu* menu = qobject_cast<QMenu*>(p))
{
QRect geom = menu->actionGeometry(next->menuAction());
QMouseEvent button_press(QEvent::MouseButtonPress,
geom.center(),
Qt::LeftButton, Qt::LeftButton, 0);
QApplication::sendEvent(menu, &button_press);
// process events before mouse up to help our sub menu show up
QCoreApplication::processEvents();
QMouseEvent button_release(QEvent::MouseButtonRelease,
geom.center(),
Qt::LeftButton, 0, 0);
QApplication::sendEvent(menu, &button_release);
while(!next->isVisible())
pqTesting::NonBlockingSleep(100);
}
}
// simulate mouse click on menu item
QRect geom = object->actionGeometry(action);
QMouseEvent button_press(QEvent::MouseButtonPress,
geom.center(),
Qt::LeftButton, Qt::LeftButton, 0);
QApplication::sendEvent(object, &button_press);
QMouseEvent button_release(QEvent::MouseButtonRelease,
geom.center(),
Qt::LeftButton, 0, 0);
QApplication::sendEvent(object, &button_release);
// TODO: If mouse happens to be over where a menu shows up
// the mouse messes up the activation of the menu item
return true;
}
if(QAbstractButton* const object = qobject_cast<QAbstractButton*>(Object))
{
object->click();
return true;
}
qCritical() << "calling activate on unhandled type " << Object;
Error = true;
return true;
}
/*=========================================================================
Program: ParaView
Module: pqAbstractActivateEventPlayer.h
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.1.
See License_v1.1.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#ifndef _pqAbstractActivateEventPlayer_h
#define _pqAbstractActivateEventPlayer_h
#include "pqWidgetEventPlayer.h"
/**
Concrete implementation of pqWidgetEventPlayer that handles playback of "activate" events for buttons and menus.
\sa pqEventPlayer
*/
class pqAbstractActivateEventPlayer :
public pqWidgetEventPlayer
{
public:
pqAbstractActivateEventPlayer();
bool playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error);
private:
pqAbstractActivateEventPlayer(const pqAbstractActivateEventPlayer&);
pqAbstractActivateEventPlayer& operator=(const pqAbstractActivateEventPlayer&);
};
#endif // !_pqAbstractActivateEventPlayer_h
/*=========================================================================
Program: ParaView
Module: pqAbstractBooleanEventPlayer.cxx
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.1.
See License_v1.1.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#include "pqAbstractBooleanEventPlayer.h"
#include <QAbstractButton>
#include <QtDebug>
pqAbstractBooleanEventPlayer::pqAbstractBooleanEventPlayer()
{
}
bool pqAbstractBooleanEventPlayer::playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error)
{
if(Command != "set_boolean")
return false;
const bool value = Arguments == "true" ? true : false;
if(QAbstractButton* const object = qobject_cast<QAbstractButton*>(Object))
{
if(value != object->isChecked())
object->setChecked(value);
return true;
}
qCritical() << "calling set_boolean on unhandled type " << Object;
Error = true;
return true;
}
/*=========================================================================
Program: ParaView
Module: pqAbstractBooleanEventPlayer.h
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.1.
See License_v1.1.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#ifndef _pqAbstractBooleanEventPlayer_h
#define _pqAbstractBooleanEventPlayer_h
#include "pqWidgetEventPlayer.h"
/**
Concrete implementation of pqWidgetEventPlayer that translates high-level ParaView events into low-level Qt events.
\sa pqEventPlayer
*/
class pqAbstractBooleanEventPlayer :
public pqWidgetEventPlayer
{
public:
pqAbstractBooleanEventPlayer();
bool playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error);
private:
pqAbstractBooleanEventPlayer(const pqAbstractBooleanEventPlayer&);
pqAbstractBooleanEventPlayer& operator=(const pqAbstractBooleanEventPlayer&);
};
#endif // !_pqAbstractBooleanEventPlayer_h
/*=========================================================================
Program: ParaView
Module: pqAbstractButtonEventTranslator.cxx
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.1.
See License_v1.1.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#include "pqAbstractButtonEventTranslator.h"
#include <QAbstractButton>
#include <QAction>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QToolButton>
#include <iostream>
pqAbstractButtonEventTranslator::pqAbstractButtonEventTranslator()
{
}
bool pqAbstractButtonEventTranslator::translateEvent(QObject* Object, QEvent* Event, bool& /*Error*/)
{
QAbstractButton* const object = qobject_cast<QAbstractButton*>(Object);
if(!object)
return false;
switch(Event->type())
{
case QEvent::KeyPress:
{
QKeyEvent* const e = static_cast<QKeyEvent*>(Event);
if(e->key() == Qt::Key_Space)
{
onActivate(object);
}
}
break;
case QEvent::MouseButtonRelease:
{
QMouseEvent* const e = static_cast<QMouseEvent*>(Event);
if(e->button() == Qt::LeftButton && object->rect().contains(e->pos()))
{
onActivate(object);
}
}
break;
default:
break;
}
return true;
}
void pqAbstractButtonEventTranslator::onActivate(QAbstractButton* object)
{
if(object->isCheckable())
{
const bool new_value = !object->isChecked();
emit recordEvent(object, "set_boolean", new_value ? "true" : "false");
}
else
{
emit recordEvent(object, "activate", "");
}
}
/*=========================================================================
Program: ParaView
Module: pqAbstractButtonEventTranslator.h
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.1.
See License_v1.1.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#ifndef _pqAbstractButtonEventTranslator_h
#define _pqAbstractButtonEventTranslator_h
#include "pqWidgetEventTranslator.h"
class QAbstractButton;
/**
Translates low-level Qt events into high-level ParaView events that can be recorded as test cases.
\sa pqEventTranslator
*/
class pqAbstractButtonEventTranslator :
public pqWidgetEventTranslator
{
Q_OBJECT
public:
pqAbstractButtonEventTranslator();
virtual bool translateEvent(QObject* Object, QEvent* Event, bool& Error);
private:
pqAbstractButtonEventTranslator(const pqAbstractButtonEventTranslator&);
pqAbstractButtonEventTranslator& operator=(const pqAbstractButtonEventTranslator&);
void onActivate(QAbstractButton*);
};
#endif // !_pqAbstractButtonEventTranslator_h
/*=========================================================================
Program: ParaView
Module: pqAbstractDoubleEventPlayer.cxx
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.1.
See License_v1.1.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#include "pqAbstractDoubleEventPlayer.h"
#include <QDoubleSpinBox>
#include <QtDebug>
pqAbstractDoubleEventPlayer::pqAbstractDoubleEventPlayer()
{
}
bool pqAbstractDoubleEventPlayer::playEvent(QObject* Object, const QString& Command, const QString& Arguments, bool& Error)
{
if(Command != "set_double")
return false;
const double value = Arguments.toDouble();
if(QDoubleSpinBox* const object = qobject_cast<QDoubleSpinBox*>(Object))
{
object->setValue(value);
return true;
}
qCritical() << "calling set_double on unhandled type " << Object;
Error = true;
return true;
}
/*=========================================================================
Program: ParaView
Module: pqAbstractDoubleEventPlayer.h
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.1.
See License_v1.1.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT