File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1390,6 +1390,16 @@ void ClipboardBrowser::keyPressEvent(QKeyEvent *event)
1390
1390
1391
1391
const int key = event->key ();
1392
1392
1393
+ // WORKAROUND: Avoid triggering search with Ctrl+Space toggle selection action.
1394
+ if (mods.testFlag (Qt::ControlModifier) && key == Qt::Key_Space) {
1395
+ const QModelIndex current = currentIndex ();
1396
+ if (!edit (current, AnyKeyPressed, event)) {
1397
+ selectionModel ()->select (current, selectionCommand (current, event));
1398
+ event->accept ();
1399
+ return ;
1400
+ }
1401
+ }
1402
+
1393
1403
// This fixes few issues with default navigation and item selections.
1394
1404
switch (key) {
1395
1405
case Qt::Key_Up:
Original file line number Diff line number Diff line change @@ -2606,6 +2606,17 @@ void Tests::selectItems()
2606
2606
2607
2607
RUN (" keys" << " CTRL+A" , " " );
2608
2608
RUN (" testSelected" , tab + " 1 0 1 2\n " );
2609
+
2610
+ // CTRL+SPACE toggles current item selection
2611
+ RUN (" add" << " D" , " " );
2612
+ RUN (" keys" << " PGUP" << " CTRL+SHIFT+DOWN" << " CTRL+SHIFT+DOWN" , " " );
2613
+ RUN (" testSelected" , tab + " 2 0\n " );
2614
+ RUN (" keys" << " CTRL+SPACE" , " " );
2615
+ RUN (" testSelected" , tab + " 2 0 2\n " );
2616
+ RUN (" keys" << " SHIFT+DOWN" , " " );
2617
+ RUN (" testSelected" , tab + " 3 0 2 3\n " );
2618
+ RUN (" keys" << " CTRL+SPACE" , " " );
2619
+ RUN (" testSelected" , tab + " 3 0 2\n " );
2609
2620
}
2610
2621
2611
2622
void Tests::moveItems ()
You can’t perform that action at this time.
0 commit comments