#include <QFrame>
#include <QHBoxLayout>
#include <QToolButton>
+#include <QEvent>
NewGeom_NestedButton::NewGeom_NestedButton(QObject* theParent,
const QList<QAction*>& theNestedActions)
QHBoxLayout* aBoxLay = new QHBoxLayout(myButtonFrame);
aBoxLay->setContentsMargins(2, 0, 0, 0);
aBoxLay->setSpacing(1);
+ QSizePolicy aSizePolicy;
+ aSizePolicy.setControlType(QSizePolicy::ToolButton);
+ myButtonFrame->setSizePolicy(aSizePolicy);
myThisButton = new QToolButton(myButtonFrame);
myThisButton->setDefaultAction(this);
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()) {