From: sbh Date: Tue, 8 Apr 2014 13:26:56 +0000 (+0400) Subject: Fix of bug with incorrect order of features in the workbench. X-Git-Tag: V_0.1~37 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b9740ad406cf288c422d175240a02f57e61deeb4;p=modules%2Fshaper.git Fix of bug with incorrect order of features in the workbench. --- diff --git a/src/XGUI/XGUI_MenuGroupPanel.cpp b/src/XGUI/XGUI_MenuGroupPanel.cpp index 4be66cee3..4f447117c 100644 --- a/src/XGUI/XGUI_MenuGroupPanel.cpp +++ b/src/XGUI/XGUI_MenuGroupPanel.cpp @@ -19,8 +19,10 @@ XGUI_MenuGroupPanel::XGUI_MenuGroupPanel(QWidget *parent) void XGUI_MenuGroupPanel::addCommand(XGUI_Command* theAction) { - myActions[theAction] = theAction->requestWidget(this); - addWidget(myActions[theAction]); + myActions.append(theAction); + QWidget* aWdg = theAction->requestWidget(this); + myActionWidget.append(aWdg); + addWidget(aWdg); } void XGUI_MenuGroupPanel::placeWidget(QWidget* theWgt) @@ -50,11 +52,10 @@ void XGUI_MenuGroupPanel::resizeEvent(QResizeEvent* theEvent) return; myMaxRow = aMaxRow; - QListIterator aIt(myActions.values()); myNewRow = 0; myNewCol = 0; - while(aIt.hasNext()) { - placeWidget(aIt.next()); + foreach(QWidget* eachWidget, myActionWidget) { + placeWidget(eachWidget); } } diff --git a/src/XGUI/XGUI_MenuGroupPanel.h b/src/XGUI/XGUI_MenuGroupPanel.h index 87f061b6e..7f9f57595 100644 --- a/src/XGUI/XGUI_MenuGroupPanel.h +++ b/src/XGUI/XGUI_MenuGroupPanel.h @@ -24,7 +24,9 @@ private: void placeWidget(QWidget* theWgt); void addCommand(XGUI_Command* theAction); - QMap myActions; + QList myActions; + QWidgetList myActionWidget; + QGridLayout* myLayout; int myNewRow; int myNewCol;