]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix of bug with incorrect order of features in the workbench.
authorsbh <sergey.belash@opencascade.com>
Tue, 8 Apr 2014 13:26:56 +0000 (17:26 +0400)
committersbh <sergey.belash@opencascade.com>
Tue, 8 Apr 2014 13:26:56 +0000 (17:26 +0400)
src/XGUI/XGUI_MenuGroupPanel.cpp
src/XGUI/XGUI_MenuGroupPanel.h

index 4be66cee3fa67e95172bcf952f20808488e1c14c..4f447117c97e1c6021f99d2aee9ba0a5777762e3 100644 (file)
@@ -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<QWidget*> aIt(myActions.values());
   myNewRow = 0;
   myNewCol = 0;
-  while(aIt.hasNext()) {
-    placeWidget(aIt.next());
+  foreach(QWidget* eachWidget, myActionWidget) {
+    placeWidget(eachWidget);
   }
 }
 
index 87f061b6e503ce7e6f5c99bd269360e76e8fb437..7f9f575957ec787affe1179db817d64ef0c84770 100644 (file)
@@ -24,7 +24,9 @@ private:
   void placeWidget(QWidget* theWgt);
   void addCommand(XGUI_Command* theAction);
 
-  QMap<XGUI_Command*, QWidget*> myActions;
+  QList<XGUI_Command*> myActions;
+  QWidgetList          myActionWidget;
+
   QGridLayout* myLayout;
   int myNewRow;
   int myNewCol;