@@ -1193,6 +1193,18 @@ void QgsAttributeTableDialog::toggleDockMode( bool docked )
1193
1193
connect ( this , &QObject::destroyed, mDock , &QWidget::close );
1194
1194
QgisApp::instance ()->addDockWidget ( Qt::BottomDockWidgetArea, mDock );
1195
1195
updateTitle ();
1196
+
1197
+ // To prevent "QAction::event: Ambiguous shortcut overload"
1198
+ QgsDebugMsgLevel ( QStringLiteral ( " Remove shortcuts from attribute table already defined in main window" ), 2 );
1199
+ mActionCopySelectedRows ->setShortcut ( QKeySequence () );
1200
+ mActionPasteFeatures ->setShortcut ( QKeySequence () );
1201
+ mActionCutSelectedRows ->setShortcut ( QKeySequence () );
1202
+ mActionZoomMapToSelectedRows ->setShortcut ( QKeySequence () );
1203
+ mActionRemoveSelection ->setShortcut ( QKeySequence () );
1204
+ mActionSelectAll ->setShortcut ( QKeySequence () );
1205
+ // duplicated on Main Window, with different semantics
1206
+ mActionPanMapToSelectedRows ->setShortcut ( QKeySequence () );
1207
+ mActionSearchForm ->setShortcut ( QKeySequence () );
1196
1208
}
1197
1209
else
1198
1210
{
@@ -1221,6 +1233,19 @@ void QgsAttributeTableDialog::toggleDockMode( bool docked )
1221
1233
updateTitle ();
1222
1234
mDialog ->restoreGeometry ( QgsSettings ().value ( QStringLiteral ( " Windows/BetterAttributeTable/geometry" ) ).toByteArray () );
1223
1235
mDialog ->show ();
1236
+
1237
+ // restore attribute table shortcuts in window mode
1238
+ QgsDebugMsgLevel ( QStringLiteral ( " Restore attribute table dialog shortcuts in window mode" ), 2 );
1239
+ // duplicated on Main Window
1240
+ mActionCopySelectedRows ->setShortcut ( QKeySequence ( QKeySequence::Copy ) );
1241
+ mActionPasteFeatures ->setShortcut ( QKeySequence ( QKeySequence::Paste ) );
1242
+ mActionCutSelectedRows ->setShortcut ( QKeySequence ( QKeySequence::Cut ) );
1243
+ mActionZoomMapToSelectedRows ->setShortcut ( QStringLiteral ( " Ctrl+J" ) );
1244
+ mActionRemoveSelection ->setShortcut ( QStringLiteral ( " Ctrl+Shift+A" ) );
1245
+ mActionSelectAll ->setShortcut ( QStringLiteral ( " Ctrl+A" ) );
1246
+ // duplicated on Main Window, with different semantics
1247
+ mActionPanMapToSelectedRows ->setShortcut ( QStringLiteral ( " Ctrl+P" ) );
1248
+ mActionSearchForm ->setShortcut ( QStringLiteral ( " Ctrl+F" ) );
1224
1249
}
1225
1250
}
1226
1251
0 commit comments