Skip to content

Commit

Permalink
Also restrict scope of Ctrl+A select all shortcut to avoid ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 4, 2020
1 parent 873716c commit 33fb57e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions python/console/console_output.py
Expand Up @@ -171,6 +171,7 @@ def __init__(self, parent=None):
self.copyShortcut.setContext(Qt.WidgetWithChildrenShortcut)
self.copyShortcut.activated.connect(self.copy)
self.selectAllShortcut = QShortcut(QKeySequence.SelectAll, self)
self.selectAllShortcut.setContext(Qt.WidgetWithChildrenShortcut)
self.selectAllShortcut.activated.connect(self.selectAll)

def insertInitText(self):
Expand Down
6 changes: 5 additions & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -2816,11 +2816,15 @@ void QgisApp::createActions()

connect( mActionDiagramProperties, &QAction::triggered, this, &QgisApp::diagramProperties );

// we can't set the shortcut on the copy action, because we need to restrict it's context to the canvas and it's children..
// we can't set the shortcut these actions, because we need to restrict their context to the canvas and it's children..
QShortcut *copyShortcut = new QShortcut( QKeySequence::Copy, mMapCanvas );
copyShortcut->setContext( Qt::WidgetWithChildrenShortcut );
connect( copyShortcut, &QShortcut::activated, this, [ = ] { copySelectionToClipboard(); } );

QShortcut *selectAllShortcut = new QShortcut( QKeySequence::SelectAll, mMapCanvas );
selectAllShortcut->setContext( Qt::WidgetWithChildrenShortcut );
connect( selectAllShortcut, &QShortcut::activated, this, &QgisApp::selectAll );

#ifndef HAVE_POSTGRESQL
delete mActionAddPgLayer;
mActionAddPgLayer = 0;
Expand Down
3 changes: 0 additions & 3 deletions src/ui/qgisapp.ui
Expand Up @@ -1253,9 +1253,6 @@
<property name="toolTip">
<string>Select All Features</string>
</property>
<property name="shortcut">
<string>Ctrl+A</string>
</property>
</action>
<action name="mActionInvertSelection">
<property name="icon">
Expand Down

0 comments on commit 33fb57e

Please sign in to comment.