]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1079: Make Apply and Cancel buttons independent on enable/disable of complex...
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 13 Nov 2015 16:04:54 +0000 (19:04 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 16 Nov 2015 08:48:07 +0000 (11:48 +0300)
src/NewGeom/NewGeom_NestedButton.cpp
src/NewGeom/NewGeom_NestedButton.h

index 787390bff336a7c2c298de9c8f4b36d17138a64a..1440d92e9705c64505f5e19367fbdf45d590bf13 100644 (file)
@@ -11,6 +11,7 @@
 #include <QFrame>
 #include <QHBoxLayout>
 #include <QToolButton>
+#include <QEvent>
 
 NewGeom_NestedButton::NewGeom_NestedButton(QObject* theParent,
                                            const QList<QAction*>& theNestedActions)
@@ -76,6 +77,18 @@ QWidget * NewGeom_NestedButton::createWidget(QWidget * theParent)
   return myButtonFrame;
 }
 
+bool NewGeom_NestedButton::event(QEvent* theEvent)
+{
+  if (theEvent->type() == QEvent::ActionChanged) {
+    if (myThisButton) {
+      myThisButton->setEnabled(isEnabled());
+      return true;
+    }
+  }
+  return QWidgetAction::event(theEvent);
+}
+
+
 void NewGeom_NestedButton::actionStateChanged()
 {
   if (isEnabled()) {
index 69d8bc2979572d682f2961095a574012608cb397..eb4eb2ea1245aa561d2443233a178dff8159e384 100644 (file)
@@ -40,6 +40,8 @@ class NewGeom_NestedButton : public QWidgetAction
   /// 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