]> Creatis software - clitk.git/blobdiff - vv/vvToolCreatorBase.cxx
Prevent segfault on close ; remove actors when close
[clitk.git] / vv / vvToolCreatorBase.cxx
index 2744dd30e7ded2496082acd0f65e69ab6e602211..f25926ca5d7f77cb23c72b9e8534167f9186f238 100644 (file)
@@ -22,7 +22,7 @@
 #include <QMenu>
 
 //------------------------------------------------------------------------------
-vvToolCreatorBase::vvToolCreatorBase(QString name): mExperimental(false), mAction(NULL)
+vvToolCreatorBase::vvToolCreatorBase(QString name): mAction(NULL), mExperimental(false)
 {
   mUseContextMenu = false;
   mToolName = name;
@@ -51,9 +51,12 @@ void vvToolCreatorBase::InsertToolInMenu(vvMainWindowBase * m)
   // Create main action
   if (mToolIconFilename == "noicon")
     mAction = new QAction(QString("&").append(mToolMenuName), this);
-  else
+  else {
     mAction = new QAction(QIcon(mToolIconFilename),
                           QString("&").append(mToolMenuName), this);
+    mAction->setIconVisibleInMenu(true);
+  }
+
   mAction->setStatusTip(mToolTip);
   // Connect the action
   connect(mAction, SIGNAL(triggered()), this, SLOT(MenuToolSlot()));