Bug 479326 - With Qt 6.6.1 or later, changing the sorting criteria of the process table to another column is very difficult
Summary: With Qt 6.6.1 or later, changing the sorting criteria of the process table to...
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: 5.92.0
Platform: Compiled Sources Linux
: NOR major
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords: qt6, usability
: 479044 480443 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-01-02 23:28 UTC by Ilya Bizyaev
Modified: 2024-02-02 12:08 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The column header is clicked, resized, clicked again, resized, repeatedly. (979.40 KB, video/webm)
2024-01-18 16:40 UTC, fin-w
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Bizyaev 2024-01-02 23:28:47 UTC
SUMMARY
E.g. if the process table is currently sorted by the name, but you want it to be sorted by the CPU usage, you have to click numerous times within the “CPU” title cell to find the specific pixel that activates that column.

This does not apply to reversing the order for the already selected column, where the entire cell is clickable.

STEPS TO REPRODUCE
1. System Monitor > Processes
2. Try to change the sorting to another column

OBSERVED RESULT
After many clicks in different parts of the cell, you finally trigger the sacred pixel that activates it :)

EXPECTED RESULT
Any pixel within the title's cell activates it, regardless of whether that column is currently active.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20231226
KDE Plasma Version: 5.91.90
KDE Frameworks Version: 5.248.0
Qt Version: 6.6.1
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-01-11 22:45:10 UTC
Cannot reproduce with today's git master built against Qt 6.6.0 with 200% scale and 11pt Noto Sans font; clicking anywhere in any table header makes the table sort by that column. My sacred pixels appear to be larger than yours!
Comment 2 Ilya Bizyaev 2024-01-12 22:11:55 UTC
When I click a column to change the sorting criterion, I get the following error in the logs:

```
qrc:/qt/qml/org/kde/ksysguard/table/BaseTableView.qml:55:5: QML TableViewHeader: Cannot change current index: TableView.selectionModel.model is not compatible with the model displayed in the view
```

This still happens with everything rebuilt just now.
Comment 3 fin-w 2024-01-13 16:05:05 UTC
I came here to submit the same bug, but also to add this: resizing the column first will display the sort arrow (up / down) for that specific column, but until the resize happens, there is no sort arrow shown even if the column is clicked. Once the resize arrow shows on one column (because you resized it), the arrow disappears from any other columns and they have this sorting issue again, until you resize them. I noticed this problem because on the fresh install, newly booted & having opened System Monitor for the first time, NONE of the sort arrows are shown and it was not possible to sort ANY of the columns. 

This happened on KDE Neon Unstable, using wayland. The system is fully updated as of today (System Monitor 5.91.90, Frameworks 5.248.0, Qt 6.6.1 built against 6.6.1).
Comment 4 fin-w 2024-01-13 17:17:38 UTC
Oh also, this issue happens in the Applications tab as well, not just in Processes. Exactly the same behaviour, from what I can see.
Comment 5 Nate Graham 2024-01-16 21:02:33 UTC
I can't reproduce any of those issues. Either they were introduced in Qt 6.6.1, or maybe old configs are causing it? Can affected people try again after moving aside (not deleting) ~/.config/plasma-systemmonitorrc and ~/.local/share/plasma-systemmonitor/ ?
Comment 6 fin-w 2024-01-18 16:40:39 UTC
Created attachment 165013 [details]
The column header is clicked, resized, clicked again, resized, repeatedly.

I updated the system just now and rebooted, and the problem remains. So this problem exists in System Monitor 6.0.80, Frameworks 5.249.0, Qt 6.6.1, and Wayland. I checked with X and I think the exact same problem is there too.

I assume `~/.config/systemmonitorrc` is what you meant, so I renamed it along with the `~/.share/plasma-systemmonitor/` directory, and opened System Monitor. It recreated the directory / file, but the problem isn't fixed and nothing seems to have changed.

What I am finding is that resizing the columns seems to prompt the column headers to update / respond? I click on a column header, nothing happens. Then I resize any column header, and the one I clicked displays the arrow and the results are sorted by that column. If I don't click anywhere first, resizing doesn't change anything. See the recording I've attached.
Comment 7 Nate Graham 2024-01-18 21:36:40 UTC
Thanks. Are all affected people using NVIDIA GPUs?
Comment 8 fin-w 2024-01-19 10:22:58 UTC
Intel HD Graphics 3000. It's a Thinkpad T420.
Comment 9 Arjen Hiemstra 2024-01-29 10:21:53 UTC
*** Bug 480443 has been marked as a duplicate of this bug. ***
Comment 10 Chad Dougherty 2024-01-30 01:45:24 UTC
I also observed this very same issue with 6.0 RC1 on Fedora Rawhide.
Comment 11 Darin Miller 2024-01-30 02:22:08 UTC
(In reply to Nate Graham from comment #7)
> Thanks. Are all affected people using NVIDIA GPUs?

Using a hybrid laptop, video mode was set to "NVidia on Demand".  Switched to Intel only via prime-select, rebooted and sort still failed.  In fact, I had to click 30 to 40 times on column titles to initiate a single sort...
Comment 12 Chad Dougherty 2024-01-30 03:19:39 UTC
(In reply to Nate Graham from comment #7)
> Thanks. Are all affected people using NVIDIA GPUs?

Mesa Intel® HD Graphics 520 (in Intel® Core™ i7-6600U CPU @ 2.60GHz)
Comment 13 Bug Janitor Service 2024-02-01 12:35:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-systemmonitor/-/merge_requests/249
Comment 14 Arjen Hiemstra 2024-02-01 16:40:06 UTC
*** Bug 479044 has been marked as a duplicate of this bug. ***
Comment 15 Arjen Hiemstra 2024-02-02 11:40:43 UTC
Git commit e3ef0d767044930615334b10640a45165638eb26 by Arjen Hiemstra.
Committed on 02/02/2024 at 11:39.
Pushed by ahiemstra into branch 'master'.

table: Fix sorting of tables using the header

A recent change in Qt enforced that the HorizontalHeaderView's
selectionModel always creates a header proxy model if an
abstractitemmodel is used for the HorizontalHeaderView's model. This
apparently broke setting the current column when using our own header
proxy model. However, we actually do not need the current column and
selection model handling, as it is just an integer property to keep
track of the column. So instead drop the selection model and track sort
column manually.

M  +6    -7    src/table/TableViewHeader.qml

https://invent.kde.org/plasma/plasma-systemmonitor/-/commit/e3ef0d767044930615334b10640a45165638eb26
Comment 16 Arjen Hiemstra 2024-02-02 12:08:03 UTC
Git commit 0c99c40481ac0f987f415c2f417983bef1fab92c by Arjen Hiemstra.
Committed on 02/02/2024 at 12:03.
Pushed by ahiemstra into branch 'Plasma/6.0'.

table: Fix sorting of tables using the header

A recent change in Qt enforced that the HorizontalHeaderView's
selectionModel always creates a header proxy model if an
abstractitemmodel is used for the HorizontalHeaderView's model. This
apparently broke setting the current column when using our own header
proxy model. However, we actually do not need the current column and
selection model handling, as it is just an integer property to keep
track of the column. So instead drop the selection model and track sort
column manually.


(cherry picked from commit e3ef0d767044930615334b10640a45165638eb26)

M  +6    -7    src/table/TableViewHeader.qml

https://invent.kde.org/plasma/plasma-systemmonitor/-/commit/0c99c40481ac0f987f415c2f417983bef1fab92c