Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG: Fix function to Disabled native menu bar if Slicer use QtTesting.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20347 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information...
commit fcd29efce34fd7d11c967f2dcba3b8917a53822f 1 parent 89bb438
benjamin.long authored
Showing with 8 additions and 11 deletions.
  1. +8 −11 Applications/SlicerApp/Main.cxx
19 Applications/SlicerApp/Main.cxx
View
@@ -76,15 +76,12 @@ namespace
#ifdef Slicer_USE_QtTesting
//-----------------------------------------------------------------------------
-void setEnableQtTesting(int argc, char* argv[])
+void setEnableQtTesting()
{
- for (int i = 0; i < argc; ++i)
+ if (qSlicerApplication::application()->commandOptions()->enableQtTesting() ||
+ qSlicerApplication::application()->settings()->value("QtTesting/Enabled").toBool())
{
- if (qstrcmp(argv[i], "--qt-testing") == 0)
- {
- QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar);
- break;
- }
+ QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar);
}
}
#endif
@@ -224,16 +221,16 @@ int SlicerAppMain(int argc, char* argv[])
QApplication::setDesktopSettingsAware(false);
QApplication::setStyle(new qSlicerStyle);
-#ifdef Slicer_USE_QtTesting
- setEnableQtTesting(argc, argv);
-#endif
-
qSlicerApplication app(argc, argv);
if (app.returnCode() != -1)
{
return app.returnCode();
}
+#ifdef Slicer_USE_QtTesting
+ setEnableQtTesting(); // disabled the native menu bar.
+#endif
+
#ifdef Slicer_USE_PYTHONQT
ctkPythonConsole pythonConsole;
if (!qSlicerApplication::testAttribute(qSlicerApplication::AA_DisablePython))
Please sign in to comment.
Something went wrong with that request. Please try again.