#include <QtApp.h>
Inheritance diagram for QtApp:
The class can be instantiates either from a main program, or from a script such as Python.
Definition at line 39 of file QtApp.h.
Public Member Functions | |
aboutQt () | |
aboutToQuit () | |
activeModalWidget () | |
activePopupWidget () | |
activeWindow () const | |
addLibraryPath (const QString &path) | |
allWidgets () | |
applicationDirPath () | |
applicationFilePath () | |
argc () const | |
argv () const | |
beep () | |
clipboard () | |
closeAllWindows () | |
closingDown () | |
colorSpec () | |
commitData (QSessionManager &sm) | |
CanvasWindow * | currentCanvas () |
Returns a pointer to the current CanvasWindow. | |
cursorFlashTime () | |
desktop () | |
desktopSettingsAware () | |
doubleClickInterval () | |
enum {DefaultCodec, UnicodeUTF8} | |
enum {NormalColor=0, CustomColor=1, ManyColor=2} | |
enum {Tty, GuiClient, GuiServer} | |
eventLoop () | |
exec () | |
exit (int retcode=0) | |
flush () | |
flushX () | |
focusWidget () const | |
font (const QWidget *w=0) | |
fontMetrics () | |
globalStrut () | |
guiThreadAwake () | |
hasGlobalMouseTracking () | |
hasPendingEvents () | |
horizontalAlignment (int align) | |
installTranslator (QTranslator *mf) | |
isEffectEnabled (Qt::UIEffect effect) | |
isSessionRestored () const | |
lastWindowClosed () | |
libraryPaths () | |
lock () | |
locked () | |
macEventFilter (EventHandlerCallRef, EventRef) | |
mainWidget () const | |
notify (QObject *receiver, QEvent *e) | |
overrideCursor () | |
palette (const QWidget *w=0) | |
polish (QWidget *w) | |
postEvent (QObject *receiver, QEvent *event) | |
processEvents (int maxtime) | |
processEvents () | |
Q_ASSERT (bool test) | |
Q_CHECK_PTR (void *p) | |
qAddPostRoutine (QtCleanUpFunction p) | |
qDebug (const char *msg,...) | |
qFatal (const char *msg,...) | |
qInstallMsgHandler (QtMsgHandler h) | |
qSysInfo (int *wordSize, bool *bigEndian) | |
qSystemWarning (const char *msg, int code) | |
QtApp (int argc, char **argv, bool gui) | |
A Constructor that enables the GUI optionally. | |
QtApp (int argc, char **argv) | |
A Constructor that always enables the GUI. | |
quit () | |
qVersion () | |
qWarning (const char *msg,...) | |
qwsDecoration () | |
qwsEventFilter (QWSEvent *) | |
qwsSetCustomColors (QRgb *colorTable, int start, int numColors) | |
qwsSetDecoration (QWSDecoration *d) | |
removeLibraryPath (const QString &path) | |
removePostedEvents (QObject *receiver) | |
removeTranslator (QTranslator *mf) | |
restoreOverrideCursor () | |
reverseLayout () | |
saveState (QSessionManager &sm) | |
sendEvent (QObject *receiver, QEvent *event) | |
sendPostedEvents () | |
sendPostedEvents (QObject *receiver, int event_type) | |
sessionId () const | |
sessionKey () const | |
setColorSpec (int spec) | |
setCursorFlashTime (int msecs) | |
setDesktopSettingsAware (bool on) | |
setDoubleClickInterval (int ms) | |
setEffectEnabled (Qt::UIEffect effect, bool enable=TRUE) | |
void | setFirstWindow () |
Sets up the first application main window. | |
setFont (const QFont &font, bool informWidgets=FALSE, const char *className=0) | |
setGlobalMouseTracking (bool enable) | |
setGlobalStrut (const QSize &strut) | |
setLibraryPaths (const QStringList &paths) | |
setMainWidget (QWidget *mainWidget) | |
setOverrideCursor (const QCursor &cursor, bool replace=FALSE) | |
setPalette (const QPalette &palette, bool informWidgets=FALSE, const char *className=0) | |
setReverseLayout (bool b) | |
setStartDragDistance (int l) | |
setStartDragTime (int ms) | |
setStyle (const QString &style) | |
setStyle (QStyle *style) | |
setWheelScrollLines (int n) | |
startDragDistance () | |
startDragTime () | |
startingUp () | |
style () | |
syncX () | |
topLevelWidgets () | |
translate (const char *context, const char *sourceText, const char *comment=0, Encoding encoding=DefaultCodec) const | |
tryLock () | |
type () const | |
unlock (bool wakeUpGui=TRUE) | |
wakeUpGuiThread () | |
wheelScrollLines () | |
widgetAt (const QPoint &pos, bool child=FALSE) | |
widgetAt (int x, int y, bool child=FALSE) | |
winEventFilter (MSG *) | |
winFocus (QWidget *widget, bool gotFocus) | |
x11EventFilter (XEvent *) | |
x11ProcessEvent (XEvent *event) | |
~QtApp () | |
The destructor. | |
Static Public Member Functions | |
static QtApp * | instance () |
Returns the application instance. | |
Private Member Functions | |
void | init () |
Method called by constructors to initialize the application. | |
bool | tryOpenFile (const std::string &name) |
Takes the string as a file name and opens the file if it is recognized. | |
Static Private Attributes | |
static QtApp * | s_instance = 0 |
The instance of the application. |
QtApp | ( | int | argc, | |
char ** | argv | |||
) |
A Constructor that always enables the GUI.
Definition at line 36 of file QtApp.cxx.
References QtApp::init().
QtApp | ( | int | argc, | |
char ** | argv, | |||
bool | gui | |||
) |
A Constructor that enables the GUI optionally.
Definition at line 42 of file QtApp.cxx.
References QtApp::init().
~QtApp | ( | ) |
The destructor.
Definition at line 84 of file QtApp.cxx.
References QApplication::closeAllWindows(), WindowController::instance(), QDir::rmdir(), and QtApp::s_instance.
CanvasWindow * currentCanvas | ( | ) |
Returns a pointer to the current CanvasWindow.
Definition at line 246 of file QtApp.cxx.
References WindowController::instance().
Referenced by PyApp::currentCanvas(), and PyApp::PyApp().
void init | ( | ) | [private] |
Method called by constructors to initialize the application.
Definition at line 51 of file QtApp.cxx.
References QDir::mkdir(), CanvasWindow::resetFontSize(), and QtApp::s_instance.
Referenced by QtApp::QtApp().
QtApp * instance | ( | ) | [static] |
Returns the application instance.
Definition at line 108 of file QtApp.cxx.
References QtApp::s_instance.
Referenced by PyApp::PyApp().
void setFirstWindow | ( | ) |
Sets up the first application main window.
When the application is started, at least one main window must appear in order to control the application. If no arguments were given to the command line start-up, then a CanvasWindow with an empty CanvasView is created. If arguments were given, then they are assumed to be a filename. If the filename suffix matches the document suffix as returned by CanvasWindow::docSuffix, then an existing document is opened. If the filename suffix matches the text NTuple suffix as returned by CanvasWindow::dataSuffix, then an empty canvas window is opened and the NTuple file imported.
Definition at line 168 of file QtApp.cxx.
References QApplication::argc(), QApplication::argv(), WindowController::instance(), QString::latin1(), WindowController::setFirstWindow(), and QtApp::tryOpenFile().
bool tryOpenFile | ( | const std::string & | name | ) | [private] |
Takes the string as a file name and opens the file if it is recognized.
If file was document, returns true
, otherwise returns false
.
Definition at line 203 of file QtApp.cxx.
References QtFileDialog::isDocSuffix(), QtFileDialog::isFitsSuffix(), QtFileDialog::isRootSuffix(), QtFileDialog::isTextSuffix(), QtFileDialog::openFitsTuple(), QtFileDialog::openRootTuple(), and QtFileDialog::openTextTuple().
Referenced by QtApp::setFirstWindow().
QtApp * s_instance = 0 [static, private] |
The instance of the application.
Definition at line 44 of file QtApp.h.
Referenced by QtApp::init(), QtApp::instance(), and QtApp::~QtApp().