Slicer
4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
#include <Base/QTGUI/qSlicerApplication.h>
Public Types | |
typedef qSlicerCoreApplication | Superclass |
Public Types inherited from qSlicerCoreApplication | |
enum | ApplicationAttribute { AA_DisablePython = 1000, AA_EnableTesting } |
enum | ReturnCode { ExitNotRequested = -1, ExitSuccess = EXIT_SUCCESS, ExitFailure = EXIT_FAILURE } |
typedef QApplication | Superclass |
Public Slots | |
void | confirmRestart (QString reason=QString()) |
QString | currentLogFile () const |
int | numberOfRecentLogFilesToKeep () |
Number of recent log files to keep. Older log files are deleted automatically. More... | |
void | openNodeModule (vtkMRMLNode *node) |
QStringList | recentLogFiles () |
Paths of recent log files. More... | |
Public Slots inherited from qSlicerCoreApplication | |
static void | restart () |
bool | unregisterResource (int handle) |
Signals | |
void | startupCompleted () |
Signals inherited from qSlicerCoreApplication | |
void | invokeEventRequested (unsigned int delay, void *caller, unsigned long event, void *callData) |
void | mrmlSceneChanged (vtkMRMLScene *mrmlScene) |
Public Member Functions | |
Q_INVOKABLE qSlicerCommandOptions * | commandOptions () const |
Get commandOptions. More... | |
Q_INVOKABLE ctkErrorLogModel * | errorLogModel () const |
Get errorLogModel. More... | |
Q_INVOKABLE qSlicerIOManager * | ioManager () |
Get IO Manager. More... | |
Q_INVOKABLE qSlicerLayoutManager * | layoutManager () const |
Set/Get layout manager. More... | |
virtual Q_INVOKABLE void | logApplicationInformation () const |
QMainWindow * | mainWindow () const |
Return a pointer on the main window of the application if any. More... | |
QString | nodeModule (vtkMRMLNode *node) const |
Return the module name that is most suitable for editing the specified node. More... | |
virtual bool | notify (QObject *receiver, QEvent *event) |
qSlicerApplication (int &argc, char **argv) | |
Q_INVOKABLE void | setLayoutManager (qSlicerLayoutManager *layoutManager) |
Q_INVOKABLE ctkSettingsDialog * | settingsDialog () const |
void | setToolTipsEnabled (bool enable) |
Enable/Disable tooltips. More... | |
virtual | ~qSlicerApplication () |
Public Member Functions inherited from qSlicerCoreApplication | |
virtual QString | acknowledgment () const |
Return the acknowledgment text of Slicer. More... | |
Q_INVOKABLE void | addModuleAssociatedNodeType (const QString &nodeClassName, const QString &moduleName) |
Q_INVOKABLE QStringList | allModuleAssociatedNodeTypes () const |
List of all node types that are associated with any module. More... | |
void | appendEnvironmentVariable (const QString &key, const QString &value, QChar separator=';') |
Q_INVOKABLE vtkSlicerApplicationLogic * | applicationLogic () const |
Get application logic. More... | |
QString | arch () const |
virtual QString | copyrights () const |
Return the copyrights of Slicer. More... | |
qSlicerCoreCommandOptions * | coreCommandOptions () const |
Get coreCommandOptions. More... | |
Q_INVOKABLE qSlicerCoreIOManager * | coreIOManager () const |
Get the IO manager. More... | |
QString | defaultExtensionsInstallPath () const |
Get slicer default extensions path. More... | |
QString | defaultScenePath () const |
Q_INVOKABLE QSettings * | defaultSettings () const |
QString | defaultTemporaryPath () const |
Get slicer default temporary directory. More... | |
Q_INVOKABLE QProcessEnvironment | environment () const |
Returns the current environment. More... | |
QString | extensionsInstallPath () const |
Get slicer extension directory. More... | |
QString | intDir () const |
bool | isEmbeddedModule (const QString &moduleFileName) const |
bool | isEnvironmentVariableValueSet (const QString &key, const QString &value) |
Returns True if environment variable identified by key is set to value. More... | |
bool | isInstalled () const |
Return true is this instance of Slicer is running from an installed directory. More... | |
bool | isRelease () const |
Return true if this instance of Slicer is a Stable release build. More... | |
QString | launcherExecutableFilePath () const |
If any, return slicer launcher executable file path. More... | |
QString | launcherRevisionSpecificUserSettingsFilePath () const |
If any, return slicer user settings file path specific to a given revision of Slicer. More... | |
QString | launcherSettingsFilePath () const |
If any, return slicer launcher settings file path. More... | |
virtual QString | libraries () const |
Return the libraries of Slicer. More... | |
int | majorVersion () const |
Return the Slicer major version number. More... | |
int | minorVersion () const |
Return the Slicer minor version number. More... | |
Q_INVOKABLE qSlicerModuleManager * | moduleManager () const |
Get the module manager. More... | |
Q_INVOKABLE QStringList | modulesAssociatedWithNodeType (const QString &nodeClassName) const |
List of all modules that are associated with the specified node type. More... | |
Q_INVOKABLE vtkMRMLScene * | mrmlScene () const |
Get MRML Scene. More... | |
QString | os () const |
void | parseArguments (bool &exitWhenDone) |
QString | platform () const |
void | prependEnvironmentVariable (const QString &key, const QString &value, QChar separator=';') |
qSlicerCoreApplication (int &argc, char **argv) | |
Q_INVOKABLE int | registerResource (const QByteArray &data) |
QString | releaseType () const |
Return the release type of this instance of Slicer. More... | |
Q_INVOKABLE void | removeModuleAssociatedNodeType (const QString &nodeClassName, const QString &moduleName) |
Remove association between a module and a node type. More... | |
QString | repositoryBranch () const |
QString | repositoryRevision () const |
QString | repositoryUrl () const |
int | returnCode () const |
Q_INVOKABLE QSettings * | revisionUserSettings () const |
void | setCoreCommandOptions (qSlicerCoreCommandOptions *options) |
void | setCoreIOManager (qSlicerCoreIOManager *ioManager) |
void | setDefaultScenePath (const QString &path) |
Set default slicer scene directory. More... | |
void | setEnvironmentVariable (const QString &key, const QString &value) |
Convenient function to set an environment variable. More... | |
void | setExtensionsInstallPath (const QString &path) |
Set slicer extension directory. More... | |
void | setTemporaryPath (const QString &path) |
Set slicer temporary directory. More... | |
Q_INVOKABLE QSettings * | settings () const |
QString | slicerDefaultSettingsFilePath () const |
QString | slicerHome () const |
QString | slicerRevisionUserSettingsFilePath () const |
QString | slicerSharePath () const |
QString | slicerUserSettingsFilePath () const |
Q_INVOKABLE QProcessEnvironment | startupEnvironment () const |
Returns the environment without the Slicer specific values. More... | |
QString | temporaryPath () const |
Get slicer temporary directory. More... | |
Q_INVOKABLE QSettings * | userSettings () const |
virtual | ~qSlicerCoreApplication () |
Static Public Member Functions | |
static qSlicerApplication * | application () |
Return a reference to the application singleton. More... | |
Static Public Member Functions inherited from qSlicerCoreApplication | |
static qSlicerCoreApplication * | application () |
Return a reference to the application singleton. More... | |
static bool | loadCaCertificates (const QString &slicerHome) |
static void | loadLanguage () |
static void | loadTranslations (const QString &dir) |
static void | setAttribute (qSlicerCoreApplication::ApplicationAttribute attribute, bool on=true) |
static bool | testAttribute (qSlicerCoreApplication::ApplicationAttribute attribute) |
Protected Member Functions | |
virtual void | handleCommandLineArguments () |
virtual void | handlePreApplicationCommandLineArguments () |
Reimplemented from qSlicerCoreApplication. More... | |
virtual void | onSlicerApplicationLogicModified () |
void | setupFileLogging () |
Protected Member Functions inherited from qSlicerCoreApplication | |
qSlicerCoreApplication (qSlicerCoreApplicationPrivate *pimpl, int &argc, char **argv) | |
virtual void | setMRMLScene (vtkMRMLScene *scene) |
Additional Inherited Members | |
Properties inherited from qSlicerCoreApplication | |
QString | arch |
QString | defaultScenePath |
QString | extensionsInstallPath |
QString | intDir |
bool | isInstalled |
bool | isRelease |
QString | launcherExecutableFilePath |
QString | launcherSettingsFilePath |
int | majorVersion |
int | minorVersion |
QString | os |
QString | platform |
QString | releaseType |
QString | repositoryBranch |
QString | repositoryRevision |
QString | repositoryUrl |
QString | slicerDefaultSettingsFilePath |
QString | slicerHome |
QString | slicerRevisionUserSettingsFilePath |
QString | slicerSharePath |
QString | slicerUserSettingsFilePath |
QString | temporaryPath |
Protected Slots inherited from qSlicerCoreApplication | |
void | invokeEvent () |
void | onSlicerApplicationLogicRequest (vtkObject *, void *, unsigned long) |
void | processAppLogicModified () |
void | processAppLogicReadData () |
void | processAppLogicWriteData () |
void | requestInvokeEvent (vtkObject *caller, void *callData) |
void | scheduleInvokeEvent (unsigned int delay, void *caller, unsigned long event, void *callData) |
void | terminate (int exitCode=qSlicerCoreApplication::ExitSuccess) |
Set the ReturnCode flag and call QCoreApplication::exit() More... | |
Protected Attributes inherited from qSlicerCoreApplication | |
QScopedPointer< qSlicerCoreApplicationPrivate > | d_ptr |
Definition at line 55 of file qSlicerApplication.h.
Definition at line 60 of file qSlicerApplication.h.
qSlicerApplication::qSlicerApplication | ( | int & | argc, |
char ** | argv | ||
) |
|
virtual |
|
static |
Return a reference to the application singleton.
Q_INVOKABLE qSlicerCommandOptions* qSlicerApplication::commandOptions | ( | ) | const |
Get commandOptions.
|
slot |
Popup a dialog asking the user if the application should be restarted. If no reason is given, the text will default to ""Are you sure you want to restart?"
|
slot |
Path of the current log file
Q_INVOKABLE ctkErrorLogModel* qSlicerApplication::errorLogModel | ( | ) | const |
Get errorLogModel.
|
protectedvirtual |
Reimplemented from qSlicerCoreApplication.
|
protectedvirtual |
Reimplemented from qSlicerCoreApplication.
Reimplemented from qSlicerCoreApplication.
Q_INVOKABLE qSlicerIOManager* qSlicerApplication::ioManager | ( | ) |
Get IO Manager.
Q_INVOKABLE qSlicerLayoutManager* qSlicerApplication::layoutManager | ( | ) | const |
Set/Get layout manager.
|
virtual |
Log application information.
This function will log the following details:
--application-information
will also print the information to standard output.QMainWindow* qSlicerApplication::mainWindow | ( | ) | const |
Return a pointer on the main window of the application if any.
QString qSlicerApplication::nodeModule | ( | vtkMRMLNode * | node | ) | const |
Return the module name that is most suitable for editing the specified node.
|
virtual |
Avoid some crashes due to execeptions thrown during inside event handlers (such as slots). When exceptions are thown from slots, Qt generates this message:
Qt has caught an exception thrown from an event handler. Throwing exceptions from an event handler is not supported in Qt. You must reimplement QApplication::notify() and catch all exceptions there.
so we follow the pattern suggested here:
|
slot |
Number of recent log files to keep. Older log files are deleted automatically.
|
protectedvirtual |
Reimplemented from qSlicerCoreApplication.
|
slot |
Utility function that retrieve the best module for a node and trigger its associated QAction which eventually opens the module.
|
slot |
Paths of recent log files.
Q_INVOKABLE void qSlicerApplication::setLayoutManager | ( | qSlicerLayoutManager * | layoutManager | ) |
Q_INVOKABLE ctkSettingsDialog* qSlicerApplication::settingsDialog | ( | ) | const |
void qSlicerApplication::setToolTipsEnabled | ( | bool | enable | ) |
Enable/Disable tooltips.
TODO See http://doc.trolltech.com/4.6/qapplication.html#commitData and http://doc.trolltech.com/4.6/qsessionmanager.html#allowsInteraction
|
protected |
Set up file logging. Creates and sets new log file and deletes the oldest one from the stored queue
|
signal |
Emitted when the startup phase has been completed.
Startup is complete when all the modules have been initialized and the main window is shown to the user.