forked from qt-creator/qt-creator
QmlDesigner: Sort names of views in menu
Change-Id: I24f260ad74c0df5ccc979fa3c21c6edba8eff9fc Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -255,6 +255,8 @@ void DesignModeWidget::setup()
|
||||
// First get all navigation views
|
||||
QList<Core::INavigationWidgetFactory *> factories = Core::INavigationWidgetFactory::allNavigationFactories();
|
||||
|
||||
QList<Core::Command*> viewCommands;
|
||||
|
||||
for (Core::INavigationWidgetFactory *factory : factories) {
|
||||
Core::NavigationView navigationView;
|
||||
navigationView.widget = nullptr;
|
||||
@@ -304,7 +306,7 @@ void DesignModeWidget::setup()
|
||||
actionToggle.withSuffix(uniqueId + "Widget"),
|
||||
designContext);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
mviews->addAction(command);
|
||||
viewCommands.append(command);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,7 +329,7 @@ void DesignModeWidget::setup()
|
||||
actionToggle.withSuffix(widgetInfo.uniqueId + "Widget"),
|
||||
designContext);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
mviews->addAction(command);
|
||||
viewCommands.append(command);
|
||||
}
|
||||
|
||||
// Finally the output pane
|
||||
@@ -347,12 +349,19 @@ void DesignModeWidget::setup()
|
||||
actionToggle.withSuffix("OutputPaneWidget"),
|
||||
designContext);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
mviews->addAction(command);
|
||||
viewCommands.append(command);
|
||||
|
||||
connect(outputPanePlaceholder, &Core::OutputPanePlaceHolder::visibilityChangeRequested,
|
||||
m_outputPaneDockWidget, &ADS::DockWidget::toggleView);
|
||||
}
|
||||
|
||||
std::sort(viewCommands.begin(), viewCommands.end(), [](Core::Command *first, Core::Command *second){
|
||||
return first->description() < second->description();
|
||||
});
|
||||
|
||||
for (Core::Command *command : viewCommands)
|
||||
mviews->addAction(command);
|
||||
|
||||
// Create toolbars
|
||||
auto toolBar = new QToolBar();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user