Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerApplication.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerApplication_h
22 #define __qSlicerApplication_h
23 
24 // Qt includes
25 #include <QPalette>
26 
27 // CTK includes
28 #include <ctkPimpl.h>
29 #include <ctkSettingsDialog.h>
30 
31 // QTCORE includes
32 #include "qSlicerCoreApplication.h"
33 
34 // QTGUI includes
35 #include "qSlicerBaseQTGUIExport.h"
36 
37 class QMainWindow;
38 class qSlicerApplicationPrivate;
40 class qSlicerIOManager;
41 #ifdef Slicer_USE_PYTHONQT
43 #endif
45 class qSlicerWidget;
46 
47 class ctkErrorLogModel;
48 #ifdef Slicer_USE_QtTesting
49 class ctkQtTestingUtility;
50 #endif
51 
52 // MRML includes
53 class vtkMRMLNode;
54 
55 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerApplication : public qSlicerCoreApplication
56 {
57  Q_OBJECT
58 public:
59 
61  qSlicerApplication(int &argc, char **argv);
62  virtual ~qSlicerApplication();
63 
66 
78  virtual bool notify(QObject * receiver, QEvent * event);
79 
81  Q_INVOKABLE ctkErrorLogModel* errorLogModel()const;
82 
84  Q_INVOKABLE qSlicerCommandOptions* commandOptions()const;
85 
87  Q_INVOKABLE qSlicerIOManager* ioManager();
88 
89  #ifdef Slicer_USE_PYTHONQT
90  Q_INVOKABLE qSlicerPythonManager * pythonManager();
92  Q_INVOKABLE ctkPythonConsole * pythonConsole();
93 #endif
94 
95  #ifdef Slicer_USE_QtTesting
96  Q_INVOKABLE ctkQtTestingUtility* testingUtility();
98  #endif
99 
101  Q_INVOKABLE qSlicerLayoutManager* layoutManager()const;
102  Q_INVOKABLE void setLayoutManager(qSlicerLayoutManager* layoutManager);
103 
105  QMainWindow* mainWindow()const;
106 
110  //virtual void commitData(QSessionManager & manager);
111 
113  void setToolTipsEnabled(bool enable);
114 
116  QString nodeModule(vtkMRMLNode* node)const;
117 
118  Q_INVOKABLE ctkSettingsDialog* settingsDialog()const;
119 
137  Q_INVOKABLE virtual void logApplicationInformation() const;
138 
139 public slots:
140 
146  void openNodeModule(vtkMRMLNode* node);
147 
150  void confirmRestart(QString reason = QString());
151 
152 #ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT
153  void openExtensionsManagerDialog();
154 #endif
155 
157  int numberOfRecentLogFilesToKeep();
158 
160  QStringList recentLogFiles();
161 
164  QString currentLogFile()const;
165 
166 signals:
167 
177  void startupCompleted();
178 
179 protected:
182  virtual void handleCommandLineArguments();
183  virtual void onSlicerApplicationLogicModified();
184 
187  void setupFileLogging();
188 
189 private:
190  Q_DECLARE_PRIVATE(qSlicerApplication);
191  Q_DISABLE_COPY(qSlicerApplication);
192 };
193 
197 void Q_SLICER_BASE_QTGUI_EXPORT qSlicerApplyPalette(QPalette& palette);
198 
199 #endif
virtual void onSlicerApplicationLogicModified()
static qSlicerCoreApplication * application()
Return a reference to the application singleton.
void Q_SLICER_BASE_QTGUI_EXPORT qSlicerApplyPalette(QPalette &palette)
qSlicerCoreApplication Superclass
virtual void handleCommandLineArguments()
virtual void handlePreApplicationCommandLineArguments()
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135