Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
25class QPalette;
26
27// CTK includes
28#include <ctkErrorLogModel.h>
29#include <ctkPimpl.h>
30#include <ctkSettingsDialog.h>
31
32// QTCORE includes
34
35// QTGUI includes
36#include "qSlicerBaseQTGUIExport.h"
37
38class QMainWindow;
39class qSlicerApplicationPrivate;
42#ifdef Slicer_USE_PYTHONQT
44#endif
46class qSlicerWidget;
47
48class ctkErrorLogModel;
49#ifdef Slicer_USE_QtTesting
50class ctkQtTestingUtility;
51#endif
52
53#ifdef Slicer_BUILD_DICOM_SUPPORT
54class ctkDICOMBrowser;
55#endif
56
57// MRML includes
58class vtkMRMLNode;
59
60class Q_SLICER_BASE_QTGUI_EXPORT qSlicerApplication : public qSlicerCoreApplication
61{
62 Q_OBJECT
63public:
65 qSlicerApplication(int& argc, char** argv);
67
70
82 bool notify(QObject* receiver, QEvent* event) override;
83
86
89
90#ifdef Slicer_USE_PYTHONQT
92 Q_INVOKABLE qSlicerPythonManager* pythonManager();
93 Q_INVOKABLE ctkPythonConsole* pythonConsole();
95 Q_INVOKABLE ctkErrorLogLevel::LogLevel pythonConsoleLogLevel() const;
96#endif
97
98#ifdef Slicer_USE_QtTesting
100 Q_INVOKABLE ctkQtTestingUtility* testingUtility();
101#endif
102
106
108 QMainWindow* mainWindow() const;
109
113 // virtual void commitData(QSessionManager& manager);
114
116 void setToolTipsEnabled(bool enable);
117
123 QString nodeModule(vtkMRMLNode* node, double* confidence = nullptr) const;
124
125 Q_INVOKABLE ctkSettingsDialog* settingsDialog() const;
126 Q_INVOKABLE void openSettingsDialog(const QString& settingsPanel = QString());
127
144 Q_INVOKABLE virtual void logApplicationInformation() const;
145
146#ifdef Slicer_BUILD_DICOM_SUPPORT
149 Q_INVOKABLE ctkDICOMBrowser* createDICOMBrowserForMainDatabase();
150#endif
151
152#ifdef Q_OS_WIN32
154 Q_INVOKABLE static unsigned long int windowsOSBuildNumber();
155
157 Q_INVOKABLE static unsigned int windowsActiveCodePage();
158#endif
159
162 Q_INVOKABLE static bool isCodePageUtf8();
163
164public slots:
165
171 void openNodeModule(vtkMRMLNode* node, QString role = QString(), QString context = QString());
172
175 void confirmRestart(QString reason = QString());
176
179 bool launchDesigner(const QStringList& args = QStringList());
180
181#ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT
183 void openExtensionsManagerDialog();
184
186 void openExtensionsCatalogWebsite();
187#endif
188
189#ifdef Slicer_BUILD_APPLICATIONUPDATE_SUPPORT
191 void openApplicationDownloadWebsite();
192#endif
193
196
198 QStringList recentLogFiles();
199
202 QString currentLogFile() const;
203
211
217 void setRenderPaused(bool pause) override;
218
221 void pauseRender() override;
222
225 void resumeRender() override;
226
228 bool loadFiles(const QStringList& filePaths, vtkMRMLMessageCollection* userMessages = nullptr) override;
229
230#ifdef Slicer_USE_PYTHONQT
232 void setPythonConsoleLogLevel(ctkErrorLogLevel::LogLevel logLevel);
233#endif
234
235signals:
236
247
252 void renderPaused(bool);
253
254protected slots:
255
257 void editNode(vtkObject*, void*, unsigned long) override;
258
259#ifdef Slicer_USE_PYTHONQT
261 void logToPythonConsole(const QDateTime& currentDateTime,
262 const QString& threadId,
263 ctkErrorLogLevel::LogLevel logLevel,
264 const QString& origin,
265 const ctkErrorLogContext& context,
266 const QString& text);
267#endif
268
269protected:
274
278
279private:
280 Q_DECLARE_PRIVATE(qSlicerApplication);
281 Q_DISABLE_COPY(qSlicerApplication);
282};
283
287void Q_SLICER_BASE_QTGUI_EXPORT qSlicerApplyPalette(QPalette& palette);
288
289#endif
void pauseRender() override
void setHasBorderInFullScreen(bool)
QStringList recentLogFiles()
Paths of recent log files.
void editNode(vtkObject *, void *, unsigned long) override
Request editing of a MRML node.
QString currentLogFile() const
static Q_INVOKABLE bool isCodePageUtf8()
static qSlicerApplication * application()
Return a reference to the application singleton.
Q_INVOKABLE qSlicerCommandOptions * commandOptions() const
Get commandOptions.
Q_INVOKABLE qSlicerIOManager * ioManager()
Get IO Manager.
void confirmRestart(QString reason=QString())
QString nodeModule(vtkMRMLNode *node, double *confidence=nullptr) const
int numberOfRecentLogFilesToKeep()
Number of recent log files to keep. Older log files are deleted automatically.
bool notify(QObject *receiver, QEvent *event) override
Q_INVOKABLE ctkSettingsDialog * settingsDialog() const
qSlicerCoreApplication Superclass
void handlePreApplicationCommandLineArguments() override
Reimplemented from qSlicerCoreApplication.
void renderPaused(bool)
qSlicerApplication(int &argc, char **argv)
void handleCommandLineArguments() override
void setRenderPaused(bool pause) override
virtual Q_INVOKABLE void logApplicationInformation() const
void resumeRender() override
Q_INVOKABLE void setLayoutManager(qSlicerLayoutManager *layoutManager)
void setToolTipsEnabled(bool enable)
Enable/Disable tooltips.
Q_INVOKABLE qSlicerLayoutManager * layoutManager() const
Set/Get layout manager.
Q_INVOKABLE void openSettingsDialog(const QString &settingsPanel=QString())
void onSlicerApplicationLogicModified() override
QMainWindow * mainWindow() const
Return a pointer on the main window of the application if any.
bool loadFiles(const QStringList &filePaths, vtkMRMLMessageCollection *userMessages=nullptr) override
Override the qSlicerCoreApplication implementation to also show error messages in a popup window.
~qSlicerApplication() override
void openNodeModule(vtkMRMLNode *node, QString role=QString(), QString context=QString())
bool launchDesigner(const QStringList &args=QStringList())
qSlicerCoreApplication(int &argc, char **argv)
Abstract Superclass for all specific types of MRML nodes.
void Q_SLICER_BASE_QTGUI_EXPORT qSlicerApplyPalette(QPalette &palette)