Bug 472501 - QListview processes 's' and 'c' characters by selecting the next item.
Summary: QListview processes 's' and 'c' characters by selecting the next item.
Status: RESOLVED NOT A BUG
Alias: None
Product: frameworks-kwindowsystem
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.104.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-22 14:33 UTC by hong
Modified: 2023-07-23 13:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hong 2023-07-22 14:33:43 UTC
SUMMARY
I have a C++ program that uses KWindowSystem and its QListview.
I call setCurrentIndex to jump to specific items when searching.
This works in most cases by setting the item as current and selected.
But sometimes, it selects and highlights the wrong item, specifically
one past the expected item; e.g., index 73 instead of 72.

STEPS TO REPRODUCE
1. in my app, it can be repeated.
2. but i have not determined the pattern.
3. i have reduced the total number of items to just 4, and it misbehaves still.

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.27.4
(available in About System)
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Comment 1 hong 2023-07-23 09:45:29 UTC
My mistake. My bug! Sorry about that.
Comment 2 hong 2023-07-23 10:45:46 UTC
Described problem in SUMMARY was due to my eventFilter returning False instead of True
when 's' was processed. QListview then moved to the next item; I was expecting item 72 but 73 was selected by QListview. This led me to believe .setCurrentIndex() was not working properly.

So, of course, when I return true in eventFilter, my program worked as expected.
My question is:
is this processing of 's' (actually also 'c') by QListview documented?
It seems like a bug to me.
Comment 3 Nicolas Fella 2023-07-23 13:32:51 UTC
What does this have to do with KWindowSystem?

KWindowSystem is a library for doing various X11/Wayland specific things, it has nothing to do with QListView and your problem.

If you think there is a bug in Qt then use https://bugreports.qt.io/ or ask in their forum