Cockatrice/cockatrice/src/interface/widgets
BruebachL bbe438b09a
[Completer] Highlight popup rows without rewriting the line edit (#7502)
* [Completer] Highlight popup rows without rewriting the line edit

Selecting a popup row with ClearAndSelect emits selectionChanged, which
QCompleter turns into highlighted() and QLineEdit turns into setText().
Since be2c16eca5 (#7466) that rewrites the typed text on every completion
reset / arrow-key press (e.g. typing "A" becomes "Axe" and cannot be
edited), regressing the 514014dc00 (#7447) fix that used NoUpdate.

Add selectWithoutRewrite(), which blocks the selection-model signals while
applying ClearAndSelect so the highlight stays visible without touching
the line edit, then syncs the preview manually. Route both the
above-popup auto-select and Up/Down navigation through it, and handle
Up/Down for below-popups too instead of falling through to Qt's
rewriting default. Enter/click acceptance via activated() is unchanged.

* [Completer] Repaint popup highlight after silent selection change

Blocking the selection model's signals also suppresses the view's own
selectionChanged/currentChanged repaints, so force a viewport update
after restoring signals. Use EnsureVisible to match Qt's normal scroll
behaviour.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-10-16 19:01:38 +02:00
..
cards [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
deck_analytics [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
deck_editor [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
deck_share [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
dialogs [Client] Warn when data paths point inside the program directory (#7473) 2026-10-11 15:34:49 +02:00
general [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
menus [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
onboarding [Client] Improve card database update visibility (#7458) 2026-10-09 11:07:48 +02:00
playmat [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
printing_selector [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
quick_settings [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
replay [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
server [GameSelector] Persist quick-filter toolbar edits and repair filter settings migration (#7500) 2026-10-13 07:45:08 +02:00
settings_page [Style] Confirm broken Windows styles with a dialog offering Fusion (#7507) 2026-10-15 12:41:01 +02:00
tabs [Game] Invalidate view when hiding replaced card menu (#7453) 2026-10-11 15:36:11 +02:00
utility [Completer] Highlight popup rows without rewriting the line edit (#7502) 2026-10-16 19:01:38 +02:00
visual_database_display [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
visual_deck_editor [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
visual_deck_storage [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00