myCommandsArea = new CommandsArea(this);
aMainLayout->addWidget(myCommandsArea);
+ myCommandsArea->viewport()->installEventFilter(this);
myChildWidget = new QWidget(myCommandsArea);
myCommandsArea->setWidget(myChildWidget);
int aWgtWidth = myChildWidget->childrenRect().width();
return ((aVPWidth - aPos.x()) < aWgtWidth);
}
+
+bool XGUI_Workbench::eventFilter(QObject *theObj, QEvent *theEvent)
+{
+ if (theObj == myCommandsArea->viewport()) {
+ if (theEvent->type() == QEvent::Resize) {
+ myLeftButton->setVisible(isExceedsLeft());
+ myRightButton->setVisible(isExceedsRight());
+ }
+ }
+ return QWidget::eventFilter(theObj, theEvent);
+}
\ No newline at end of file