Salome HOME
Hide scroll bar in SALOME
[modules/shaper.git] / src / SHAPERGUI / SHAPERGUI_NestedButton.cpp
index 0ce9e0133694861dd1a8924ac3ce54101817767c..02753ac05c74282118c423a6887f7413904b49cb 100644 (file)
@@ -11,6 +11,7 @@
 #include <QFrame>
 #include <QHBoxLayout>
 #include <QToolButton>
+#include <QToolBar>
 #include <QEvent>
 
 SHAPERGUI_NestedButton::SHAPERGUI_NestedButton(QObject* theParent,
@@ -43,6 +44,12 @@ void SHAPERGUI_NestedButton::showAdditionalButtons(bool isShow)
 
 QWidget * SHAPERGUI_NestedButton::createWidget(QWidget * theParent)
 {
+  // the action has widget only in tool bar, in menu bar, the default
+  // action presentation is shown
+  QToolBar* aToolBar = dynamic_cast<QToolBar*>(theParent);
+  if (!aToolBar)
+    return 0;
+
   myButtonFrame = new QFrame(theParent);
   QHBoxLayout* aBoxLay = new QHBoxLayout(myButtonFrame);
   aBoxLay->setContentsMargins(2, 0, 0, 0);