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
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.
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.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-systemmonitor/-/merge_requests/349
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.
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