Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Properties | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes
qSlicerCoreApplication Class Reference

#include <Base/QTCore/qSlicerCoreApplication.h>

Inheritance diagram for qSlicerCoreApplication:
Inheritance graph
[legend]
Collaboration diagram for qSlicerCoreApplication:
Collaboration graph
[legend]

Public Types

enum  ApplicationAttribute { AA_DisablePython = 1000, AA_EnableTesting }
 
enum  ReturnCode { ExitNotRequested = -1, ExitSuccess = EXIT_SUCCESS, ExitFailure = EXIT_FAILURE }
 
typedef QApplication Superclass
 

Properties

QString arch
 
QString cachePath
 
QString defaultScenePath
 
QString documentationBaseUrl
 
QString documentationLanguage
 
QString documentationVersion
 
QString extensionsInstallPath
 
QString intDir
 
bool isCustomMainApplication
 
bool isInstalled
 
QString launcherExecutableFilePath
 
QString launcherSettingsFilePath
 
int mainApplicationMajorVersion
 
int mainApplicationMinorVersion
 
QString mainApplicationName
 
int mainApplicationPatchVersion
 
QString mainApplicationRepositoryRevision
 
QString mainApplicationRepositoryUrl
 
QString mainApplicationRevision
 
int majorVersion
 
int minorVersion
 
QString os
 
QString platform
 
QString releaseType
 
QString repositoryBranch
 
QString repositoryRevision
 
QString repositoryUrl
 
QString revision
 
QString slicerDefaultSettingsFilePath
 
QString slicerHome
 
QString slicerRevisionUserSettingsFilePath
 
QString slicerSharePath
 
QString slicerUserSettingsFilePath
 
QString startupWorkingPath
 
QString temporaryPath
 

Public Slots

static void restart ()
 
virtual void setRenderPaused (bool pause)
 
bool unregisterResource (int handle)
 

Signals

void invokeEventRequested (unsigned int delay, void *caller, unsigned long event, void *callData)
 
void mrmlSceneChanged (vtkMRMLScene *mrmlScene)
 
void urlReceived (QString url)
 

Public Member Functions

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...
 
Q_INVOKABLE void appendEnvironmentVariable (const QString &key, const QString &value, QChar separator=';')
 
Q_INVOKABLE vtkSlicerApplicationLogicapplicationLogic () const
 Get application logic. More...
 
QString arch () const
 
QString cachePath () const
 
virtual QString copyrights () const
 Return the copyrights of Slicer. More...
 
qSlicerCoreCommandOptionscoreCommandOptions () const
 Get coreCommandOptions. More...
 
Q_INVOKABLE qSlicerCoreIOManagercoreIOManager () const
 Get the IO manager. More...
 
QString defaultCachePath () const
 
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...
 
QString documentationBaseUrl () const
 
QString documentationLanguage () const
 
QString documentationVersion () const
 
Q_INVOKABLE QProcessEnvironment environment () const
 Returns the current environment. More...
 
Q_INVOKABLE ctkErrorLogAbstractModel * errorLogModel () const
 Get errorLogModel. More...
 
QString extensionsInstallPath () const
 Get slicer extension directory. More...
 
QString intDir () const
 
bool isCustomMainApplication () const
 Return if main application is custom application (not Slicer). More...
 
bool isEmbeddedModule (const QString &moduleFileName) const
 
Q_INVOKABLE 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...
 
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...
 
virtual bool loadFiles (const QStringList &filePaths, vtkMRMLMessageCollection *userMessages=nullptr)
 
int mainApplicationMajorVersion () const
 
int mainApplicationMinorVersion () const
 
QString mainApplicationName () const
 Return the name of the main application. More...
 
int mainApplicationPatchVersion () const
 
QString mainApplicationRepositoryRevision () const
 
QString mainApplicationRepositoryUrl () const
 
QString mainApplicationRevision () const
 
int majorVersion () const
 Return the Slicer major version number. More...
 
int minorVersion () const
 Return the Slicer minor version number. More...
 
Q_INVOKABLE QString moduleDocumentationUrl (const QString &moduleName) const
 
Q_INVOKABLE vtkMRMLAbstractLogicmoduleLogic (const QString &moduleName) const
 
Q_INVOKABLE qSlicerModuleManagermoduleManager () 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 vtkMRMLScenemrmlScene () const
 Get MRML Scene. More...
 
virtual void openUrl (const QString &url)
 
QString os () const
 
void parseArguments (bool &exitWhenDone)
 
virtual void pauseRender ()
 
QString platform () const
 
Q_INVOKABLE 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
 
virtual void resumeRender ()
 
int returnCode () const
 
QString revision () const
 Return Slicer's user-friendly revision identifier. More...
 
Q_INVOKABLE QSettings * revisionUserSettings () const
 
void setCachePath (const QString &path)
 
void setCoreCommandOptions (qSlicerCoreCommandOptions *options)
 
void setCoreIOManager (qSlicerCoreIOManager *ioManager)
 
void setDefaultScenePath (const QString &path)
 Set default slicer scene directory. More...
 
Q_INVOKABLE 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
 
Q_INVOKABLE void showConsoleMessage (QString message, bool error=true) 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 startupWorkingPath () const
 Current working directory at the time the application was started. More...
 
QString temporaryPath () const
 Get slicer temporary directory. More...
 
Q_INVOKABLE QString toSlicerHomeAbsolutePath (const QString &path) const
 
Q_INVOKABLE QStringList toSlicerHomeAbsolutePaths (const QStringList &path) const
 
Q_INVOKABLE QString toSlicerHomeRelativePath (const QString &path) const
 
Q_INVOKABLE QStringList toSlicerHomeRelativePaths (const QStringList &path) const
 
Q_INVOKABLE QSettings * userSettings () const
 
 ~qSlicerCoreApplication () override
 

Static Public Member Functions

static qSlicerCoreApplicationapplication ()
 
static int exec ()
 
static Q_INVOKABLE bool loadCaCertificates (const QString &slicerHome)
 
static Q_INVOKABLE void loadLanguage ()
 
static Q_INVOKABLE void loadTranslations (const QString &dir)
 
static void setAttribute (qSlicerCoreApplication::ApplicationAttribute attribute, bool on=true)
 
static bool testAttribute (qSlicerCoreApplication::ApplicationAttribute attribute)
 
static Q_INVOKABLE QStringList translationFolders ()
 Return list of folders where the application looks for translations (*.qm files) More...
 

Protected Slots

virtual void editNode (vtkObject *, void *, unsigned long)
 
virtual void handleCommandLineArguments ()
 
virtual void onSlicerApplicationLogicModified ()
 
void onSlicerApplicationLogicRequest (vtkObject *, void *, unsigned long)
 
virtual void onUserInformationModified ()
 
void processAppLogicModified ()
 
void processAppLogicReadData ()
 
void processAppLogicWriteData ()
 

Protected Member Functions

virtual void handlePreApplicationCommandLineArguments ()
 
void invokeEvent ()
 
virtual void onAboutToQuit ()
 Perform application cleanup following a call to QCoreApplication::exit(). More...
 
 qSlicerCoreApplication (qSlicerCoreApplicationPrivate *pimpl, int &argc, char **argv)
 
void requestInvokeEvent (vtkObject *caller, void *callData)
 
void scheduleInvokeEvent (unsigned int delay, void *caller, unsigned long event, void *callData)
 
virtual void setMRMLScene (vtkMRMLScene *scene)
 
void terminate (int exitCode=qSlicerCoreApplication::ExitSuccess)
 Set the ReturnCode flag and call QCoreApplication::exit() More...
 

Protected Attributes

QScopedPointer< qSlicerCoreApplicationPrivate > d_ptr
 

Detailed Description

Definition at line 62 of file qSlicerCoreApplication.h.

Member Typedef Documentation

◆ Superclass

typedef QApplication qSlicerCoreApplication::Superclass

Definition at line 110 of file qSlicerCoreApplication.h.

Member Enumeration Documentation

◆ ApplicationAttribute

Used in addition to existing QCoreApplication attribute.

See also
Qt::ApplicationAttribute
Enumerator
AA_DisablePython 
AA_EnableTesting 

Definition at line 121 of file qSlicerCoreApplication.h.

◆ ReturnCode

Enumerator
ExitNotRequested 
ExitSuccess 
ExitFailure 

Definition at line 187 of file qSlicerCoreApplication.h.

Property Documentation

◆ arch

QString qSlicerCoreApplication::arch
read

Definition at line 97 of file qSlicerCoreApplication.h.

◆ cachePath

QString qSlicerCoreApplication::cachePath
readwrite

Definition at line 76 of file qSlicerCoreApplication.h.

◆ defaultScenePath

QString qSlicerCoreApplication::defaultScenePath
readwrite

Definition at line 73 of file qSlicerCoreApplication.h.

◆ documentationBaseUrl

QString qSlicerCoreApplication::documentationBaseUrl
read

Definition at line 93 of file qSlicerCoreApplication.h.

◆ documentationLanguage

QString qSlicerCoreApplication::documentationLanguage
read

Definition at line 95 of file qSlicerCoreApplication.h.

◆ documentationVersion

QString qSlicerCoreApplication::documentationVersion
read

Definition at line 94 of file qSlicerCoreApplication.h.

◆ extensionsInstallPath

QString qSlicerCoreApplication::extensionsInstallPath
readwrite

Definition at line 83 of file qSlicerCoreApplication.h.

◆ intDir

QString qSlicerCoreApplication::intDir
read

Definition at line 84 of file qSlicerCoreApplication.h.

◆ isCustomMainApplication

bool qSlicerCoreApplication::isCustomMainApplication
read

Definition at line 99 of file qSlicerCoreApplication.h.

◆ isInstalled

bool qSlicerCoreApplication::isInstalled
read

Definition at line 85 of file qSlicerCoreApplication.h.

◆ launcherExecutableFilePath

QString qSlicerCoreApplication::launcherExecutableFilePath
read

Definition at line 78 of file qSlicerCoreApplication.h.

◆ launcherSettingsFilePath

QString qSlicerCoreApplication::launcherSettingsFilePath
read

Definition at line 79 of file qSlicerCoreApplication.h.

◆ mainApplicationMajorVersion

int qSlicerCoreApplication::mainApplicationMajorVersion
read

Definition at line 104 of file qSlicerCoreApplication.h.

◆ mainApplicationMinorVersion

int qSlicerCoreApplication::mainApplicationMinorVersion
read

Definition at line 105 of file qSlicerCoreApplication.h.

◆ mainApplicationName

QString qSlicerCoreApplication::mainApplicationName
read

Definition at line 100 of file qSlicerCoreApplication.h.

◆ mainApplicationPatchVersion

int qSlicerCoreApplication::mainApplicationPatchVersion
read

Definition at line 106 of file qSlicerCoreApplication.h.

◆ mainApplicationRepositoryRevision

QString qSlicerCoreApplication::mainApplicationRepositoryRevision
read

Definition at line 102 of file qSlicerCoreApplication.h.

◆ mainApplicationRepositoryUrl

QString qSlicerCoreApplication::mainApplicationRepositoryUrl
read

Definition at line 101 of file qSlicerCoreApplication.h.

◆ mainApplicationRevision

QString qSlicerCoreApplication::mainApplicationRevision
read

Definition at line 103 of file qSlicerCoreApplication.h.

◆ majorVersion

int qSlicerCoreApplication::majorVersion
read

Definition at line 91 of file qSlicerCoreApplication.h.

◆ minorVersion

int qSlicerCoreApplication::minorVersion
read

Definition at line 92 of file qSlicerCoreApplication.h.

◆ os

QString qSlicerCoreApplication::os
read

Definition at line 98 of file qSlicerCoreApplication.h.

◆ platform

QString qSlicerCoreApplication::platform
read

Definition at line 96 of file qSlicerCoreApplication.h.

◆ releaseType

QString qSlicerCoreApplication::releaseType
read

Definition at line 86 of file qSlicerCoreApplication.h.

◆ repositoryBranch

QString qSlicerCoreApplication::repositoryBranch
read

Definition at line 88 of file qSlicerCoreApplication.h.

◆ repositoryRevision

QString qSlicerCoreApplication::repositoryRevision
read

Definition at line 89 of file qSlicerCoreApplication.h.

◆ repositoryUrl

QString qSlicerCoreApplication::repositoryUrl
read

Definition at line 87 of file qSlicerCoreApplication.h.

◆ revision

QString qSlicerCoreApplication::revision
read

Definition at line 90 of file qSlicerCoreApplication.h.

◆ slicerDefaultSettingsFilePath

QString qSlicerCoreApplication::slicerDefaultSettingsFilePath
read

Definition at line 80 of file qSlicerCoreApplication.h.

◆ slicerHome

QString qSlicerCoreApplication::slicerHome
read

This property holds the path where the Slicer application is. For example, for an installed Slicer on Windows, the path can be "C:\Program Files (x86)\Slicer 4.4.0\".

See also
slicerHome(), temporaryPath, isInstalled

Definition at line 72 of file qSlicerCoreApplication.h.

◆ slicerRevisionUserSettingsFilePath

QString qSlicerCoreApplication::slicerRevisionUserSettingsFilePath
read

Definition at line 82 of file qSlicerCoreApplication.h.

◆ slicerSharePath

QString qSlicerCoreApplication::slicerSharePath
read

Definition at line 74 of file qSlicerCoreApplication.h.

◆ slicerUserSettingsFilePath

QString qSlicerCoreApplication::slicerUserSettingsFilePath
read

Definition at line 81 of file qSlicerCoreApplication.h.

◆ startupWorkingPath

QString qSlicerCoreApplication::startupWorkingPath
read

Definition at line 77 of file qSlicerCoreApplication.h.

◆ temporaryPath

QString qSlicerCoreApplication::temporaryPath
readwrite

Definition at line 75 of file qSlicerCoreApplication.h.

Constructor & Destructor Documentation

◆ qSlicerCoreApplication() [1/2]

qSlicerCoreApplication::qSlicerCoreApplication ( int &  argc,
char **  argv 
)

◆ ~qSlicerCoreApplication()

qSlicerCoreApplication::~qSlicerCoreApplication ( )
override

◆ qSlicerCoreApplication() [2/2]

qSlicerCoreApplication::qSlicerCoreApplication ( qSlicerCoreApplicationPrivate *  pimpl,
int &  argc,
char **  argv 
)
protected

Member Function Documentation

◆ acknowledgment()

virtual QString qSlicerCoreApplication::acknowledgment ( ) const
virtual

Return the acknowledgment text of Slicer.

◆ addModuleAssociatedNodeType()

Q_INVOKABLE void qSlicerCoreApplication::addModuleAssociatedNodeType ( const QString &  nodeClassName,
const QString &  moduleName 
)

Associate a module with a node type. It is currently only used for determining which module can edit a specific node. If multiple modules are registered for the same class then the node widget's nodeEditable method is used for determining which module is the most suitable for editing.

◆ allModuleAssociatedNodeTypes()

Q_INVOKABLE QStringList qSlicerCoreApplication::allModuleAssociatedNodeTypes ( ) const

List of all node types that are associated with any module.

◆ appendEnvironmentVariable()

Q_INVOKABLE void qSlicerCoreApplication::appendEnvironmentVariable ( const QString &  key,
const QString &  value,
QChar  separator = ';' 
)

Convenient function allowing to append value to environment variable identified by by key using separator

◆ application()

static qSlicerCoreApplication* qSlicerCoreApplication::application ( )
static

Return a reference to the application singleton. It returns nullptr if the current application is not based on qSlicerCoreApplication class (for example, in Qt Designer executable loads widget plugins).

◆ applicationLogic()

Q_INVOKABLE vtkSlicerApplicationLogic* qSlicerCoreApplication::applicationLogic ( ) const

Get application logic.

◆ arch()

QString qSlicerCoreApplication::arch ( ) const

Return the arch associated to this build

See also
qSlicerCoreApplicationPrivate::discoverRepository

◆ cachePath()

QString qSlicerCoreApplication::cachePath ( ) const

Get cache directory. It is a temporary folder that contains files that can be useful to be kept between application sessions. For example, files downloaded from network, which may not need to be downloaded again if stored locally.

◆ copyrights()

virtual QString qSlicerCoreApplication::copyrights ( ) const
virtual

Return the copyrights of Slicer.

◆ coreCommandOptions()

qSlicerCoreCommandOptions* qSlicerCoreApplication::coreCommandOptions ( ) const

Get coreCommandOptions.

◆ coreIOManager()

Q_INVOKABLE qSlicerCoreIOManager* qSlicerCoreApplication::coreIOManager ( ) const

Get the IO manager.

◆ defaultCachePath()

QString qSlicerCoreApplication::defaultCachePath ( ) const

Get default cache directory.

See also
cachePath()

◆ defaultExtensionsInstallPath()

QString qSlicerCoreApplication::defaultExtensionsInstallPath ( ) const

Get slicer default extensions path.

◆ defaultScenePath()

QString qSlicerCoreApplication::defaultScenePath ( ) const

Get default scene directory

This returns the full path where scenes are saved to by default

◆ defaultSettings()

Q_INVOKABLE QSettings* qSlicerCoreApplication::defaultSettings ( ) const

Get slicer application default settings.

See also
slicerDefaultSettingsFilePath()

◆ defaultTemporaryPath()

QString qSlicerCoreApplication::defaultTemporaryPath ( ) const

Get slicer default temporary directory.

◆ documentationBaseUrl()

QString qSlicerCoreApplication::documentationBaseUrl ( ) const

Return the documentation base URL. By default, https://slicer.readthedocs.io/{language}/{version} but it can be changed in the application settings (DocumentationBaseURL). Use "latest" version for Preview (installed preview release) and Experimental (developer build), and use "majorVersion.minorVersion" for Stable release.

◆ documentationLanguage()

QString qSlicerCoreApplication::documentationLanguage ( ) const

Return the documentation language that can be used in URLs. Returns "en" if internationalization is disabled.

◆ documentationVersion()

QString qSlicerCoreApplication::documentationVersion ( ) const

Return the documentation version that can be used in URLs. Returns "latest" version for Preview (installed preview release) and Experimental (developer build), and use "majorVersion.minorVersion" for Stable release.

◆ editNode

virtual void qSlicerCoreApplication::editNode ( vtkObject *  ,
void *  ,
unsigned  long 
)
inlineprotectedvirtualslot

Editing of a MRML node has been requested. Implemented in qSlicerApplication.

Definition at line 602 of file qSlicerCoreApplication.h.

◆ environment()

Q_INVOKABLE QProcessEnvironment qSlicerCoreApplication::environment ( ) const

Returns the current environment.

The returned environment contains all values found in the launcher settings.

Note
Environment variables set from python updating os.environ or set from c++ directly calling putenv() will NOT be found in the environment returned by this function.
See also
setEnvironmentVariable(const QString& key, const QString& value);

◆ errorLogModel()

Q_INVOKABLE ctkErrorLogAbstractModel* qSlicerCoreApplication::errorLogModel ( ) const

Get errorLogModel.

◆ exec()

static int qSlicerCoreApplication::exec ( )
static

Enters the main event loop and waits until exit(), quit() or terminate() is called.

To ensure that python exceptions occurring during the module unloading performed in onAboutToQuit() are considered, it is important to start the event loop directly calling this function.

Note that the override of return code if an exception is raised during module cleanup happens only if testing mode is enabled.

See also
QApplication::exec(), returnCode()

◆ extensionsInstallPath()

QString qSlicerCoreApplication::extensionsInstallPath ( ) const

Get slicer extension directory.

◆ handleCommandLineArguments

virtual void qSlicerCoreApplication::handleCommandLineArguments ( )
protectedvirtualslot

Process command line arguments atfer the application event loop is started.

See also
handlePreApplicationCommandLineArguments()
qSlicerApplication::startupCompleted()

Reimplemented in qSlicerApplication.

◆ handlePreApplicationCommandLineArguments()

virtual void qSlicerCoreApplication::handlePreApplicationCommandLineArguments ( )
protectedvirtual

Process command line arguments before the application event loop is started.

See also
handleCommandLineArguments()
qSlicerApplication::startupCompleted()

Reimplemented in qSlicerApplication.

◆ intDir()

QString qSlicerCoreApplication::intDir ( ) const

If any, this method return the build intermediate directory See on https://msdn.microsoft.com/en-us/library/c02as0cs%28VS.71%29.aspx

◆ invokeEvent()

void qSlicerCoreApplication::invokeEvent ( )
protected

Internal method called only when a special QTimer times out. The timer contains dynamic properties describing an event to invoke on a specific object.

See also
requestInvokeEvent

◆ invokeEventRequested

void qSlicerCoreApplication::invokeEventRequested ( unsigned int  delay,
void *  caller,
unsigned long  event,
void *  callData 
)
signal

Internal method used to move an invocation from a thread to the main thread.

See also
requestInvokeEvent(), scheduleInvokeEvent()

◆ isCustomMainApplication()

bool qSlicerCoreApplication::isCustomMainApplication ( ) const

Return if main application is custom application (not Slicer).

◆ isEmbeddedModule()

bool qSlicerCoreApplication::isEmbeddedModule ( const QString &  moduleFileName) const

Returns True if module identified by moduleFileName is a descendant of slicer home.

See also
slicerHome()

◆ isEnvironmentVariableValueSet()

Q_INVOKABLE bool qSlicerCoreApplication::isEnvironmentVariableValueSet ( const QString &  key,
const QString &  value 
)

Returns True if environment variable identified by key is set to value.

◆ isInstalled()

bool qSlicerCoreApplication::isInstalled ( ) const

Return true is this instance of Slicer is running from an installed directory.

◆ launcherExecutableFilePath()

QString qSlicerCoreApplication::launcherExecutableFilePath ( ) const

If any, return slicer launcher executable file path.

◆ launcherRevisionSpecificUserSettingsFilePath()

QString qSlicerCoreApplication::launcherRevisionSpecificUserSettingsFilePath ( ) const

If any, return slicer user settings file path specific to a given revision of Slicer.

◆ launcherSettingsFilePath()

QString qSlicerCoreApplication::launcherSettingsFilePath ( ) const

If any, return slicer launcher settings file path.

◆ libraries()

virtual QString qSlicerCoreApplication::libraries ( ) const
virtual

Return the libraries of Slicer.

◆ loadCaCertificates()

static Q_INVOKABLE bool qSlicerCoreApplication::loadCaCertificates ( const QString &  slicerHome)
static

Load certificates bundled into '<slicerHome>/<SLICER_SHARE_DIR>/Slicer.crt'. For more details, see Slicer/Base/QTCore/Resources/Certs/README Returns False if 'Slicer.crt' failed to be loaded.

See also
QSslSocket::defaultCaCertificates()

◆ loadFiles()

virtual bool qSlicerCoreApplication::loadFiles ( const QStringList &  filePaths,
vtkMRMLMessageCollection userMessages = nullptr 
)
virtual

Load files into the application.

Parameters
userMessagesif specified then loading errors are returned via this object.
Returns
Returns true on success.

◆ loadLanguage()

static Q_INVOKABLE void qSlicerCoreApplication::loadLanguage ( )
static

Load translations from all *.qm files in translation folders.

See also
translationFolders(), loadTranslations

◆ loadTranslations()

static Q_INVOKABLE void qSlicerCoreApplication::loadTranslations ( const QString &  dir)
static

Load translations from all *.qm files in the specified folders.

See also
loadLanguage()

◆ mainApplicationMajorVersion()

int qSlicerCoreApplication::mainApplicationMajorVersion ( ) const

Return the main application's major version number. Useful for custom applications.

◆ mainApplicationMinorVersion()

int qSlicerCoreApplication::mainApplicationMinorVersion ( ) const

Return the main application's minor version number. Useful for custom applications.

◆ mainApplicationName()

QString qSlicerCoreApplication::mainApplicationName ( ) const

Return the name of the main application.

◆ mainApplicationPatchVersion()

int qSlicerCoreApplication::mainApplicationPatchVersion ( ) const

Return the main application's patch version number. Useful for custom applications.

◆ mainApplicationRepositoryRevision()

QString qSlicerCoreApplication::mainApplicationRepositoryRevision ( ) const

Return the main application's source repository Revision associated with this build. Useful for custom applications.

See also
qSlicerCoreApplicationPrivate::discoverRepository

◆ mainApplicationRepositoryUrl()

QString qSlicerCoreApplication::mainApplicationRepositoryUrl ( ) const

Return the main application's source repository URL associated with this build. Useful for custom applications.

See also
qSlicerCoreApplicationPrivate::discoverRepository

◆ mainApplicationRevision()

QString qSlicerCoreApplication::mainApplicationRevision ( ) const

Return the main application's user-friendly revision identifier. Useful for custom applications.

◆ majorVersion()

int qSlicerCoreApplication::majorVersion ( ) const

Return the Slicer major version number.

◆ minorVersion()

int qSlicerCoreApplication::minorVersion ( ) const

Return the Slicer minor version number.

◆ moduleDocumentationUrl()

Q_INVOKABLE QString qSlicerCoreApplication::moduleDocumentationUrl ( const QString &  moduleName) const

Return the documentation base URL. By default, {documentationbaseurl}/user_guide/modules/{lowercasemodulename}.html but it can be changed in the application settings (ModuleDocumentationURL).

◆ moduleLogic()

Q_INVOKABLE vtkMRMLAbstractLogic* qSlicerCoreApplication::moduleLogic ( const QString &  moduleName) const

◆ moduleManager()

Q_INVOKABLE qSlicerModuleManager* qSlicerCoreApplication::moduleManager ( ) const

Get the module manager.

◆ modulesAssociatedWithNodeType()

Q_INVOKABLE QStringList qSlicerCoreApplication::modulesAssociatedWithNodeType ( const QString &  nodeClassName) const

List of all modules that are associated with the specified node type.

◆ mrmlScene()

Q_INVOKABLE vtkMRMLScene* qSlicerCoreApplication::mrmlScene ( ) const

Get MRML Scene.

◆ mrmlSceneChanged

void qSlicerCoreApplication::mrmlSceneChanged ( vtkMRMLScene mrmlScene)
signal

◆ onAboutToQuit()

virtual void qSlicerCoreApplication::onAboutToQuit ( )
protectedvirtual

Perform application cleanup following a call to QCoreApplication::exit().

◆ onSlicerApplicationLogicModified

virtual void qSlicerCoreApplication::onSlicerApplicationLogicModified ( )
protectedvirtualslot

Reimplemented in qSlicerApplication.

◆ onSlicerApplicationLogicRequest

void qSlicerCoreApplication::onSlicerApplicationLogicRequest ( vtkObject *  ,
void *  ,
unsigned  long 
)
protectedslot

◆ onUserInformationModified

virtual void qSlicerCoreApplication::onUserInformationModified ( )
protectedvirtualslot

◆ openUrl()

virtual void qSlicerCoreApplication::openUrl ( const QString &  url)
virtual

Open URL in the the application. Emits urlReceived signal that modules (such as DICOM module) can handle.

Parameters
urlURL string to open

◆ os()

QString qSlicerCoreApplication::os ( ) const

Return the os associated to this build

See also
qSlicerCoreApplicationPrivate::discoverRepository

◆ parseArguments()

void qSlicerCoreApplication::parseArguments ( bool &  exitWhenDone)

Parse arguments

Note
If exitWhenDone is True, it's your responsibility to exit the application

◆ pauseRender()

virtual void qSlicerCoreApplication::pauseRender ( )
inlinevirtual

Equivalent to setRenderPaused(true)

See also
setRenderPaused

Definition at line 560 of file qSlicerCoreApplication.h.

◆ platform()

QString qSlicerCoreApplication::platform ( ) const

Return the platform associated to this build

See also
qSlicerCoreApplicationPrivate::discoverRepository

◆ prependEnvironmentVariable()

Q_INVOKABLE void qSlicerCoreApplication::prependEnvironmentVariable ( const QString &  key,
const QString &  value,
QChar  separator = ';' 
)

Convenient function allowing to prepend value to environment variable identified by by key using separator

◆ processAppLogicModified

void qSlicerCoreApplication::processAppLogicModified ( )
protectedslot

◆ processAppLogicReadData

void qSlicerCoreApplication::processAppLogicReadData ( )
protectedslot

◆ processAppLogicWriteData

void qSlicerCoreApplication::processAppLogicWriteData ( )
protectedslot

◆ registerResource()

Q_INVOKABLE int qSlicerCoreApplication::registerResource ( const QByteArray &  data)

◆ releaseType()

QString qSlicerCoreApplication::releaseType ( ) const

Return the release type of this instance of Slicer.

Release type can be Experimental, Nightly or Stable.

◆ removeModuleAssociatedNodeType()

Q_INVOKABLE void qSlicerCoreApplication::removeModuleAssociatedNodeType ( const QString &  nodeClassName,
const QString &  moduleName 
)

Remove association between a module and a node type.

◆ repositoryBranch()

QString qSlicerCoreApplication::repositoryBranch ( ) const

Return the Slicer source repository Branch associated with this build

See also
qSlicerCoreApplicationPrivate::discoverRepository

◆ repositoryRevision()

QString qSlicerCoreApplication::repositoryRevision ( ) const

Return the Slicer source repository Revision associated with this build

See also
qSlicerCoreApplicationPrivate::discoverRepository

◆ repositoryUrl()

QString qSlicerCoreApplication::repositoryUrl ( ) const

Return the Slicer source repository URL associated with this build

See also
qSlicerCoreApplicationPrivate::discoverRepository

◆ requestInvokeEvent()

void qSlicerCoreApplication::requestInvokeEvent ( vtkObject *  caller,
void *  callData 
)
protected

Called when the application logic requests a delayed event invocation. When the singleton application logic fires the RequestInvokeEvent,

See also
invokeEvent(), vtkMRMLApplicationLogic::InvokeRequest
onSlicerApplicationLogicRequest(), processAppLogicModified()

◆ restart

static void qSlicerCoreApplication::restart ( )
staticslot

Restart the application with the arguments passed at startup time

See also
QCoreApplication::arguments()

◆ resumeRender()

virtual void qSlicerCoreApplication::resumeRender ( )
inlinevirtual

Equivalent to setRenderPaused(false)

See also
setRenderPaused

Definition at line 563 of file qSlicerCoreApplication.h.

◆ returnCode()

int qSlicerCoreApplication::returnCode ( ) const

Return exit code that may be set before the main event loop started or after it exited.

After parsing arguments and before starting the event loop using exec(), returnCode is set if early exit was requested or if there was a parsing error.

After exiting the event loop, returnCode is set if there was an error during cleanup performed in onAboutToQuit().

Returns -1 if the application has not been asked to exit. EXIT_SUCCESS (0) if the application must return in success. EXIT_FAILURE (1) if the application failed.

See also
exec()

◆ revision()

QString qSlicerCoreApplication::revision ( ) const

Return Slicer's user-friendly revision identifier.

◆ revisionUserSettings()

Q_INVOKABLE QSettings* qSlicerCoreApplication::revisionUserSettings ( ) const

Get revision specific slicer application user settings

Note
It will also instantiate a QSettings object if required.
See also
slicerRevisionSpecificUserSettingsFilePath()

◆ scheduleInvokeEvent()

void qSlicerCoreApplication::scheduleInvokeEvent ( unsigned int  delay,
void *  caller,
unsigned long  event,
void *  callData 
)
protected

a timer is created, and on timeout, invokeEvent() is called to propagate the requested event invocation.

See also
invokeEventRequested(), requestInvokeEvent(), invokeEvent()

◆ setAttribute()

static void qSlicerCoreApplication::setAttribute ( qSlicerCoreApplication::ApplicationAttribute  attribute,
bool  on = true 
)
static
See also
QCoreApplication::setAttribute

◆ setCachePath()

void qSlicerCoreApplication::setCachePath ( const QString &  path)

Set cache directory.

See also
cachePath()

◆ setCoreCommandOptions()

void qSlicerCoreApplication::setCoreCommandOptions ( qSlicerCoreCommandOptions options)

Set coreCommandOptions

Note
qSlicerCoreApplication takes ownership of the object

◆ setCoreIOManager()

void qSlicerCoreApplication::setCoreIOManager ( qSlicerCoreIOManager ioManager)

Set the IO manager

Note
qSlicerCoreApplication takes ownership of the object

◆ setDefaultScenePath()

void qSlicerCoreApplication::setDefaultScenePath ( const QString &  path)

Set default slicer scene directory.

◆ setEnvironmentVariable()

Q_INVOKABLE void qSlicerCoreApplication::setEnvironmentVariable ( const QString &  key,
const QString &  value 
)

Convenient function to set an environment variable.

Note
Using this function will ensure that the environment is up-to-date for processes started using QProcess or other alternative methods.

◆ setExtensionsInstallPath()

void qSlicerCoreApplication::setExtensionsInstallPath ( const QString &  path)

Set slicer extension directory.

◆ setMRMLScene()

virtual void qSlicerCoreApplication::setMRMLScene ( vtkMRMLScene scene)
protectedvirtual

◆ setRenderPaused

virtual void qSlicerCoreApplication::setRenderPaused ( bool  pause)
inlinevirtualslot

Calls setRenderPaused(pause) on the current layout manager. Emits pauseRenderRequested() if pause is true and resumeRenderRequested() if pause is false. The caller is responsible for making sure that each setRenderPaused(true) is paired with setRenderPaused(false). Implemented in qSlicerApplication

See also
qSlicerApplication::setRenderPaused()

Definition at line 557 of file qSlicerCoreApplication.h.

◆ setTemporaryPath()

void qSlicerCoreApplication::setTemporaryPath ( const QString &  path)

Set slicer temporary directory.

◆ settings()

Q_INVOKABLE QSettings* qSlicerCoreApplication::settings ( ) const

This function has been deprecated: userSettings() should be used.

Deprecated:
See also
userSettings()

◆ showConsoleMessage()

Q_INVOKABLE void qSlicerCoreApplication::showConsoleMessage ( QString  message,
bool  error = true 
) const

Print message on console. If error is true then the message is printed on stderr, otherwise on stdout.

◆ slicerDefaultSettingsFilePath()

QString qSlicerCoreApplication::slicerDefaultSettingsFilePath ( ) const

If any, return slicer default settings file path.

See also
defaultSettings()

◆ slicerHome()

QString qSlicerCoreApplication::slicerHome ( ) const

Get slicer home directory

See also
slicerHome

◆ slicerRevisionUserSettingsFilePath()

QString qSlicerCoreApplication::slicerRevisionUserSettingsFilePath ( ) const

Return slicer settings file path specific to a given revision of Slicer.

See also
revisionUserSettings()

◆ slicerSharePath()

QString qSlicerCoreApplication::slicerSharePath ( ) const

Get slicer share directory

This returns the partial path where slicer resources are located, which is normally of the form "share/Slicer-<i>version</i>".

See also
slicerSharePath, slicerHome()

◆ slicerUserSettingsFilePath()

QString qSlicerCoreApplication::slicerUserSettingsFilePath ( ) const

Return slicer user settings file path.

See also
userSettings()

◆ startupEnvironment()

Q_INVOKABLE QProcessEnvironment qSlicerCoreApplication::startupEnvironment ( ) const

Returns the environment without the Slicer specific values.

Path environment variables like PATH, LD_LIBRARY_PATH or PYTHONPATH will not contain values found in the launcher settings.

Similarly key=value environment variables also found in the launcher settings are excluded. Note that if a value was associated with a key prior starting Slicer, it will not be set in the environment returned by this function.

The function excludes both the Slicer launcher settings and the revision specific launcher settings.

See also
launcherSettingsFilePath(), launcherRevisionSpecificUserSettingsFilePath()
repositoryRevision()
environment()

◆ startupWorkingPath()

QString qSlicerCoreApplication::startupWorkingPath ( ) const

Current working directory at the time the application was started.

◆ temporaryPath()

QString qSlicerCoreApplication::temporaryPath ( ) const

Get slicer temporary directory.

◆ terminate()

void qSlicerCoreApplication::terminate ( int  exitCode = qSlicerCoreApplication::ExitSuccess)
protected

Set the ReturnCode flag and call QCoreApplication::exit()

◆ testAttribute()

static bool qSlicerCoreApplication::testAttribute ( qSlicerCoreApplication::ApplicationAttribute  attribute)
static
See also
QCoreApplication::testAttribute

◆ toSlicerHomeAbsolutePath()

Q_INVOKABLE QString qSlicerCoreApplication::toSlicerHomeAbsolutePath ( const QString &  path) const

Converts relative path to absolute path using slicerHome directory. Returns absolute path unchanged.

◆ toSlicerHomeAbsolutePaths()

Q_INVOKABLE QStringList qSlicerCoreApplication::toSlicerHomeAbsolutePaths ( const QStringList &  path) const

Converts relative path to absolute path using slicerHome directory. Returns absolute path unchanged.

◆ toSlicerHomeRelativePath()

Q_INVOKABLE QString qSlicerCoreApplication::toSlicerHomeRelativePath ( const QString &  path) const

Converts paths within slicerHome directory to relative paths. Leaves other paths unchanged.

◆ toSlicerHomeRelativePaths()

Q_INVOKABLE QStringList qSlicerCoreApplication::toSlicerHomeRelativePaths ( const QStringList &  path) const

Converts paths within slicerHome directory to relative paths. Leaves other paths unchanged.

◆ translationFolders()

static Q_INVOKABLE QStringList qSlicerCoreApplication::translationFolders ( )
static

Return list of folders where the application looks for translations (*.qm files)

◆ unregisterResource

bool qSlicerCoreApplication::unregisterResource ( int  handle)
slot

◆ urlReceived

void qSlicerCoreApplication::urlReceived ( QString  url)
signal

Signal is emitted when a url argument is processed with the slicer:// protocol The url string is emitted with the signal. Modules can connect to this signal to handle url arguments.

◆ userSettings()

Q_INVOKABLE QSettings* qSlicerCoreApplication::userSettings ( ) const

Get slicer application user settings

Note
It will also instantiate a QSettings object if required.
See also
slicerUserSettingsFilePath()

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerCoreApplicationPrivate> qSlicerCoreApplication::d_ptr
protected

Definition at line 642 of file qSlicerCoreApplication.h.


The documentation for this class was generated from the following file: