#include <QFrame>
#include <QHBoxLayout>
#include <QToolButton>
+#include <QEvent>
NewGeom_NestedButton::NewGeom_NestedButton(QObject* theParent,
const QList<QAction*>& theNestedActions)
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()) {
/// 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