| Summary: | Ctrl+A does not work in the list | ||
|---|---|---|---|
| Product: | [Applications] plasma-systemmonitor | Reporter: | Sin Jeong-hun <typingcat> |
| Component: | general | Assignee: | KSysGuard Developers <ksysguard-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | 4wy78uwh, ahiemstra, kde, nate, plasma-bugs-null |
| Priority: | NOR | Keywords: | usability |
| Version First Reported In: | 6.2.5 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/plasma/plasma-systemmonitor/-/commit/d09a12dcfc1b87b14b0b0d13b513adfc1b8bb6f5 | Version Fixed/Implemented In: | 6.4.0 |
| Sentry Crash Report: | |||
|
Description
Sin Jeong-hun
2025-01-24 23:02:29 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.
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 |