Skip to content

Commit c088067

Browse files
committed
ENH: Add "exit-after-startup" command line option.
This is useful to "measure" startup time. Note that part of the implementation of this feature was accidentally integrated in the previous commit. git-svn-id: http://svn.slicer.org/Slicer4/trunk@25059 3bd1e089-480b-0410-8dfb-8563597acbee
1 parent a42f00c commit c088067

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Base/QTGUI/qSlicerCommandOptions.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ bool qSlicerCommandOptions::enableQtTesting()const
6565
#endif
6666
}
6767

68+
//-----------------------------------------------------------------------------
69+
bool qSlicerCommandOptions::exitAfterStartup()const
70+
{
71+
return this->parsedArgs().value("exit-after-startup").toBool();
72+
}
73+
6874
//-----------------------------------------------------------------------------
6975
void qSlicerCommandOptions::addArguments()
7076
{
@@ -91,4 +97,7 @@ void qSlicerCommandOptions::addArguments()
9197
this->addArgument("qt-testing", "", QVariant::Bool,
9298
"Enable QtTesting in the user interface");
9399
#endif
100+
101+
this->addArgument("exit-after-startup", "", QVariant::Bool,
102+
"Exit after startup is complete. Useful for measuring startup time");
94103
}

Base/QTGUI/qSlicerCommandOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Q_SLICER_BASE_QTGUI_EXPORT qSlicerCommandOptions : public qSlicerCoreComma
3636
Q_PROPERTY(bool noMainWindow READ noMainWindow CONSTANT)
3737
Q_PROPERTY(bool showPythonInteractor READ showPythonInteractor CONSTANT)
3838
Q_PROPERTY(bool enableQtTesting READ enableQtTesting CONSTANT)
39+
Q_PROPERTY(bool exitAfterStartup READ exitAfterStartup CONSTANT)
3940
public:
4041
typedef qSlicerCoreCommandOptions Superclass;
4142
qSlicerCommandOptions();
@@ -51,6 +52,8 @@ class Q_SLICER_BASE_QTGUI_EXPORT qSlicerCommandOptions : public qSlicerCoreComma
5152

5253
bool enableQtTesting()const;
5354

55+
bool exitAfterStartup()const;
56+
5457
protected:
5558
virtual void addArguments();
5659

0 commit comments

Comments
 (0)