]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[bos #42437] fixed problem where sketch validation icons in toolbar were not activated V9_13_BR mbs/42437 V9_13_0 V9_13_0rc2 V9_13_0rc3 66/head
authormbs <martin.bernhard@opencascade.com>
Thu, 4 Jul 2024 08:22:45 +0000 (09:22 +0100)
committermbs <martin.bernhard@opencascade.com>
Fri, 2 Aug 2024 08:32:33 +0000 (09:32 +0100)
src/SHAPERGUI/SHAPERGUI_NestedButton.cpp
src/SHAPERGUI/SHAPERGUI_NestedButton.h

index 63c896400ea4eeb6aa4ed698d44cb3e9350251cc..59fde50207a7331b973a9f91b93d3fb6174e7172 100644 (file)
@@ -106,3 +106,14 @@ QWidget * SHAPERGUI_NestedButton::createWidget(QWidget * theParent)
   connect(this, SIGNAL(toggled(bool)), this, SLOT(showAdditionalButtons(bool)));
   return myButtonFrame;
 }
+
+bool SHAPERGUI_NestedButton::event(QEvent* theEvent)
+{
+  if (theEvent->type() == QEvent::ActionChanged) {
+    if (myThisButton) {
+      myThisButton->setEnabled(isEnabled());
+      return true;
+    }
+  }
+  return QtxAction::event(theEvent);
+}
index d3c1a1842d58793c1f45925edbe260175fde8fcf..9940b5062756306f2b4e28162339a8cc68194dde 100644 (file)
@@ -28,6 +28,9 @@
 #define SRC_SHAPERGUI_NESTEDBUTTON_H_
 
 #include <QtxAction.h>
+#include <QList>
+#include <QPointer>
+
 
 class QFrame;
 class QAction;
@@ -60,12 +63,13 @@ protected:
   /// Creates the button representation
   /// \param theParent a parent widget
   virtual QWidget * createWidget(QWidget * theParent);
+  virtual bool event(QEvent* theEvent);
 
 private:
   QList<QAction*> myNestedActions; ///< list of nested actions
-  QWidget* myAdditionalButtonsWidget; ///< widget to precess additional buttons visibility
-  QFrame* myButtonFrame; ///< frame arround button representation
-  QToolButton* myThisButton; ///< main button
+  QPointer<QWidget> myAdditionalButtonsWidget; ///< widget to process additional buttons visibility
+  QPointer<QFrame> myButtonFrame; ///< frame around button representation
+  QPointer<QToolButton> myThisButton; ///< main button
 };
 
 #endif /* SRC_SHAPERGUI_NESTEDBUTTON_H_ */