+
+
+bool XGUI_MainMenu::eventFilter(QObject *theWatched, QEvent *theEvent)
+{
+ if (theWatched == myGeneralPage) {
+ if (theEvent->type() == QEvent::Show) {
+ myGeneralPage->parentWidget()->setMaximumWidth(16777215);
+ myGeneralPage->removeEventFilter(this);
+ }
+ }
+ return QObject::eventFilter(theWatched, theEvent);
+}
+
+XGUI_Command* XGUI_MainMenu::feature(const QString& theId) const
+{
+ QList<QDockWidget*>::const_iterator aIt;
+ for (aIt = myMenuTabs.constBegin(); aIt != myMenuTabs.constEnd(); ++aIt) {
+ XGUI_Workbench* aWbn = static_cast<XGUI_Workbench*>((*aIt)->widget());
+ XGUI_Command* aCmd = aWbn->feature(theId);
+ if (aCmd)
+ return aCmd;
+ }
+ return 0;
+}
+
+QList<XGUI_Command*> XGUI_MainMenu::features() const
+{
+ QList<XGUI_Command*> aList;
+ QList<QDockWidget*>::const_iterator aIt;
+ for (aIt = myMenuTabs.constBegin(); aIt != myMenuTabs.constEnd(); ++aIt) {
+ XGUI_Workbench* aWbn = static_cast<XGUI_Workbench*>((*aIt)->widget());
+ aList.append(aWbn->features());
+ }
+ return aList;
+}
+
+QList<XGUI_Workbench*> XGUI_MainMenu::workbenches() const
+{
+ QList<XGUI_Workbench*> aList;
+ aList.append(myGeneralPage);
+ foreach(QDockWidget* aDoc, myMenuTabs) {
+ XGUI_Workbench* aWb = dynamic_cast<XGUI_Workbench*>(aDoc->widget());
+ if (aWb)
+ aList.append(aWb);
+ }
+ return aList;
+}
\ No newline at end of file