From 405d3ee1cac4c162c633bf150e079e5abcf83e3f Mon Sep 17 00:00:00 2001 From: Gaurav Pruthi Date: Fri, 1 Oct 2021 20:24:15 +0530 Subject: [PATCH] Add feature to sort groups using shortcut keys (#6999) * Register Ctrl + Down to sort A->Z and Ctrl + Up to sort Z->A --- src/gui/group/GroupView.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/group/GroupView.cpp b/src/gui/group/GroupView.cpp index 83d737bc87..6024de5f10 100644 --- a/src/gui/group/GroupView.cpp +++ b/src/gui/group/GroupView.cpp @@ -45,6 +45,13 @@ GroupView::GroupView(Database* db, QWidget* parent) new QShortcut(Qt::CTRL + Qt::Key_F10, this, SLOT(contextMenuShortcutPressed()), nullptr, Qt::WidgetShortcut); + // keyboard shortcuts to sort children of a group + auto shortcut = new QShortcut(Qt::CTRL + Qt::Key_Down, this); + connect(shortcut, &QShortcut::activated, this, [this]() { sortGroups(false); }); + + shortcut = new QShortcut(Qt::CTRL + Qt::Key_Up, this); + connect(shortcut, &QShortcut::activated, this, [this]() { sortGroups(true); }); + modelReset(); setDragEnabled(true);