Commit 1f6dc5e5 authored by Eike Ziller's avatar Eike Ziller Committed by Bill King

Debug and Analyze mode context menus were reshuffling.

Sort the items alphabetically to counter measure reordering of
QMainWindow child dockwidgets.

Change-Id: Ia79ffcb2dcd0c313184bc7bcafb7a4482db72a21
Reviewed-on: default avatarBill King <>
Reviewed-by: default avatarhjk <>
parent d7c2c23d
......@@ -32,6 +32,8 @@
#include "fancymainwindow.h"
#include "qtcassert.h"
#include <QtCore/QList>
#include <QtCore/QHash>
......@@ -265,17 +267,28 @@ bool FancyMainWindow::isLocked() const
return d->m_locked;
static bool actionLessThan(const QAction *action1, const QAction *action2)
QTC_ASSERT(action1, return true);
QTC_ASSERT(action2, return false);
return action1->text().toLower() < action2->text().toLower();
QMenu *FancyMainWindow::createPopupMenu()
QMenu *menu = new QMenu(this);
QList<QAction *> actions;
QList<QDockWidget *> dockwidgets = qFindChildren<QDockWidget *>(this);
for (int i = 0; i < dockwidgets.size(); ++i) {
QDockWidget *dockWidget =;
if (dockWidget->property("managed_dockwidget").isNull()
&& dockWidget->parentWidget() == this) {
qSort(actions.begin(), actions.end(), actionLessThan);
QMenu *menu = new QMenu(this);
foreach (QAction *action, actions)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment