A class to interface Python to application running in separate thread. More...
#include <PyApp.h>
Public Member Functions | |
PyCanvas * | currentCanvas () |
Returns a pointer to the current CanvasWindow. | |
int | exec () |
Starts the QApplication event loop. | |
bool | hasTerminated () const |
Returns true if the application as terminated, otherwise returns false . | |
void | openDocument (const std::string &filename) |
Opens a new document from file filename. | |
PyApp () | |
The default Constructor. | |
PyApp (int) | |
A constructor that created QtApp without threading. | |
PyApp (char *script) | |
A constructor taking script name as argument. | |
void | quit () |
Terminates the application. | |
void | quitOnLastWindowClose (bool yes) |
If yes is true , allows the application to quit when the last CanvasWindow is closed by the user. | |
~PyApp () | |
The destructor. | |
Static Public Member Functions | |
static bool | hasPendingEvents () |
Returns true if the application object has pending events. | |
static PyApp * | instance () |
Returns the application instance. | |
static void | lock () |
Obtains a lock on the application's mutex. | |
static bool | locked () |
returns true if the Application mutex is locked by different thread. | |
static void | unlock () |
Releases the lock on the application's mutex. | |
Private Attributes | |
HdThread * | m_thread |
The thread in which to run the GUI. | |
Static Private Attributes | |
static QtApp * | s_app = 0 |
The QApplication object. | |
static PyApp * | s_instance = 0 |
The instance of the application. |
A class to interface Python to application running in separate thread.
PyApp | ( | ) |
PyApp | ( | int | ) |
PyApp | ( | char * | script | ) |
~PyApp | ( | ) |
PyCanvas * currentCanvas | ( | ) |
Returns a pointer to the current CanvasWindow.
int exec | ( | ) |
Starts the QApplication event loop.
bool hasPendingEvents | ( | ) | [static] |
Returns true
if the application object has pending events.
Definition at line 370 of file PyApp.cxx.
References QApplication::closingDown().
Referenced by PyCanvas::addDisplay().
bool hasTerminated | ( | ) | const |
Returns true
if the application as terminated, otherwise returns false
.
Definition at line 269 of file PyApp.cxx.
References QApplication::closingDown().
PyApp * instance | ( | ) | [static] |
void lock | ( | ) | [static] |
Obtains a lock on the application's mutex.
For Qt 3, obtains a lock on the application's mutex, for Qt 4 does nothing.
Definition at line 331 of file PyApp.cxx.
References QApplication::closingDown().
Referenced by PyNTuple::addColumn(), QtDisplay::addDataRep(), QtDisplay::addDataRepStacked(), QtDisplay::addFunction(), PyNTuple::addRow(), PyDataSource::addRow(), QtCut::addTarget(), QtCut::addTargets(), PyCanvas::addText(), PyCanvas::addTextAt(), PyCanvas::addTextAtAbs(), PyCanvas::addTextRep(), QtDisplay::addValues(), PyNTuple::append(), PyDataSource::append(), QtDisplay::applyCut(), QtDisplay::applyCuts(), PyNTuple::clear(), PyCanvas::close(), QtDisplay::createDataArray(), QtCut::createFits(), QtRootController::createNTuple(), QtDisplay::createNTuple(), QtCut::createNTuple(), PyNTupleController::createNTuple(), QtCut::createTnt(), QtCut::cutRange(), QtDisplay::deleteView(), QtRootNTuple::expandIfNeeded(), QtRootNTuple::getColumn(), QtRootNTuple::getColumnShape(), QtDisplay::getDataRep(), QtDisplay::getDataReps(), PyCanvas::getDisplay(), PyCanvas::getDisplays(), QtDisplay::getLabel(), QtRootController::getNTupleNames(), PyCanvas::getPickTable(), QtDisplay::getRange(), QtRootNTuple::getRow(), PyCanvas::getSelPickTable(), QtRootNTuple::isMultiDimensional(), QtDisplay::nextView(), PyCanvas::print(), PyCanvas::PyCanvas(), QtCut::QtCut(), QtDisplay::QtDisplay(), PyNTupleController::registerNTuple(), PyNTuple::replaceColumn(), QtDisplay::reset(), QtDisplay::resize(), QtRootNTuple::rows(), PyCanvas::saveAs(), PyDataSource::saveColumnFromNumArray(), PyCanvas::saveSelectedImages(), PyCanvas::selectAllDisplays(), PyCanvas::selectDisplay(), QtDisplay::setAspectRatio(), QtDisplay::setAutoRanging(), QtDisplay::setAutoTicks(), QtDisplay::setBinWidth(), QtDisplay::setColorMap(), QtDisplay::setContourLevels(), QtCut::setCutRange(), QtCut::setEnabled(), PyCanvas::setHeight(), QtDisplay::setLabel(), QtDisplay::setLog(), QtDisplay::setNumberOfBins(), QtDisplay::setOffset(), PyCanvas::setPlotMatrix(), QtDisplay::setPointRep(), QtDisplay::setRange(), QtDisplay::setTicks(), QtDisplay::setTitle(), PyNTuple::setTitle(), QtDisplay::setTransform(), QtDisplay::setView(), PyCanvas::setWidth(), PyCanvas::setX(), PyCanvas::setY(), PyCanvas::show(), QtCut::toggleInverted(), QtDisplay::update(), and PyFitsController::writeToFile().
bool locked | ( | ) | [static] |
returns true
if the Application mutex is locked by different thread.
Definition at line 344 of file PyApp.cxx.
References QApplication::closingDown().
void openDocument | ( | const std::string & | filename | ) |
void quitOnLastWindowClose | ( | bool | yes | ) |
If yes is true
, allows the application to quit when the last CanvasWindow is closed by the user.
void unlock | ( | ) | [static] |
Releases the lock on the application's mutex.
For Qt 3, releases the lock on the application's mutex, for Qt 4 does nothing.
Definition at line 357 of file PyApp.cxx.
References QApplication::closingDown().
Referenced by PyNTuple::addColumn(), PyNTuple::addRow(), PyDataSource::addRow(), PyCanvas::addText(), PyCanvas::addTextAt(), PyCanvas::addTextAtAbs(), PyCanvas::addTextRep(), PyNTuple::append(), PyDataSource::append(), PyNTuple::clear(), PyCanvas::close(), QtRootController::createNTuple(), PyNTupleController::createNTuple(), QtRootNTuple::expandIfNeeded(), QtRootNTuple::getColumn(), QtRootNTuple::getColumnShape(), PyCanvas::getDisplay(), PyCanvas::getDisplays(), QtRootController::getNTupleNames(), PyCanvas::getPickTable(), QtRootNTuple::getRow(), PyCanvas::getSelPickTable(), QtRootNTuple::isMultiDimensional(), PyCanvas::print(), PyCanvas::PyCanvas(), PyNTupleController::registerNTuple(), PyNTuple::replaceColumn(), QtRootNTuple::rows(), PyCanvas::saveAs(), PyCanvas::saveAsImage(), PyDataSource::saveColumnFromNumArray(), PyCanvas::saveSelectedImages(), PyCanvas::selectAllDisplays(), PyCanvas::selectDisplay(), PyCanvas::setHeight(), PyCanvas::setPlotMatrix(), PyNTuple::setTitle(), PyCanvas::setWidth(), PyCanvas::setX(), PyCanvas::setY(), PyCanvas::show(), and PyFitsController::writeToFile().
The QApplication object.
PyApp * s_instance = 0 [static, private] |