From b9740ad406cf288c422d175240a02f57e61deeb4 Mon Sep 17 00:00:00 2001 From: sbh Date: Tue, 8 Apr 2014 17:26:56 +0400 Subject: [PATCH] Fix of bug with incorrect order of features in the workbench. --- src/XGUI/XGUI_MenuGroupPanel.cpp | 11 ++++++----- src/XGUI/XGUI_MenuGroupPanel.h | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) 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; -- 2.39.2