From: mbs Date: Thu, 4 Jul 2024 08:22:45 +0000 (+0100) Subject: [bos #42437] fixed problem where sketch validation icons in toolbar were not activated X-Git-Tag: V9_13_0rc2^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmbs%2F42437;p=modules%2Fshaper.git [bos #42437] fixed problem where sketch validation icons in toolbar were not activated --- diff --git a/src/SHAPERGUI/SHAPERGUI_NestedButton.cpp b/src/SHAPERGUI/SHAPERGUI_NestedButton.cpp index 63c896400..59fde5020 100644 --- a/src/SHAPERGUI/SHAPERGUI_NestedButton.cpp +++ b/src/SHAPERGUI/SHAPERGUI_NestedButton.cpp @@ -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); +} diff --git a/src/SHAPERGUI/SHAPERGUI_NestedButton.h b/src/SHAPERGUI/SHAPERGUI_NestedButton.h index d3c1a1842..9940b5062 100644 --- a/src/SHAPERGUI/SHAPERGUI_NestedButton.h +++ b/src/SHAPERGUI/SHAPERGUI_NestedButton.h @@ -28,6 +28,9 @@ #define SRC_SHAPERGUI_NESTEDBUTTON_H_ #include +#include +#include + 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 myNestedActions; ///< list of nested actions - QWidget* myAdditionalButtonsWidget; ///< widget to precess additional buttons visibility - QFrame* myButtonFrame; ///< frame arround button representation - QToolButton* myThisButton; ///< main button + QPointer myAdditionalButtonsWidget; ///< widget to process additional buttons visibility + QPointer myButtonFrame; ///< frame around button representation + QPointer myThisButton; ///< main button }; #endif /* SRC_SHAPERGUI_NESTEDBUTTON_H_ */