Bug 499112 - Ctrl+A does not work in the list
Summary: Ctrl+A does not work in the list
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: 6.2.5
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2025-01-24 23:02 UTC by Sin Jeong-hun
Modified: 2025-03-22 14:19 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.4.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sin Jeong-hun 2025-01-24 23:02:29 UTC
SUMMARY
In the lists (Applications/Processes), Ctrl + A has no effect. I don't think it makes sense, because I can select multiple (even all) items by shift/ctrl click anyway.

STEPS TO REPRODUCE
1. Press Ctrl + A
2. 
3. 

OBSERVED RESULT
No effect.

EXPECTED RESULT
All items selected.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.12.10-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2025-01-28 22:40:52 UTC
diff --git src/table/BaseTableView.qml src/table/BaseTableView.qml
index 4dbc3d7..55211d4 100644
--- src/table/BaseTableView.qml
+++ src/table/BaseTableView.qml
@@ -52,6 +52,17 @@ FocusScope {
     Kirigami.Theme.inherit: false
     Kirigami.Theme.colorSet: Kirigami.Theme.View
 
+    function selectAll() {
+        for(let i = 0; i < rows; i++) {
+            selection.select(tableView.index(i, 0), ItemSelectionModel.Select | ItemSelectionModel.Rows)
+        }
+    }
+
+    Shortcut {
+        sequences: [StandardKey.SelectAll]
+        onActivated: root.selectAll();
+    }
+
     TableViewHeader {
         id: heading

This technically works, but on the process table it's so slow that it's not usable. Probably there's a better implementation I didn't find. Also, it only works while the table view has focus. Ideally it would work more broadly.

I'm leaving this here for someone else to refine into a mergeable patch.
Comment 2 Kai Uwe Broulik 2025-01-29 06:42:34 UTC
ItemSelectionModel also takes a "select" with a QItemSelection. However, there seems to be no way to create one from QML (except for maybe this weird "as" syntax that I am not sure they’ll keep).

Looks like we need to create a factory method that creates us a QItemSelection from topleft to bottomright and then use that. Or we fix QtQuick Controls TableView to support the shortcut by itself like the Qt Widgets one does.
Comment 3 Bug Janitor Service 2025-03-17 17:42:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-systemmonitor/-/merge_requests/349
Comment 4 Arjen Hiemstra 2025-03-17 17:43:42 UTC
The above MR uses two `select()` calls to get this done, it still takes some time when using select all with "show all processes" but for most cases I think it's acceptable.
Comment 5 Arjen Hiemstra 2025-03-19 12:50:09 UTC
Git commit d09a12dcfc1b87b14b0b0d13b513adfc1b8bb6f5 by Arjen Hiemstra.
Committed on 19/03/2025 at 12:42.
Pushed by ahiemstra into branch 'master'.

Add a shortcut for selecting all rows in a table view

M  +11   -0    src/table/BaseTableView.qml

https://invent.kde.org/plasma/plasma-systemmonitor/-/commit/d09a12dcfc1b87b14b0b0d13b513adfc1b8bb6f5