Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
12 July 2022
This episode shows a specialized combo box for solving this simple problem:
I had a combo box for choosing employees in KDAB. It even supported that I typed in part of their names to search. However, with a Danish keyboard, I had no way of typing the names of Lukáš or Miłosz.
So, I implemented a combo box where I could type Lukas or Milosz to search for these names (observe the names are in plain ascii).
Links:
* Bug report on inline editing: https://bugreports.qt.io/browse/QTBUG-101453
* Bug report on completion not working: https://bugreports.qt.io/browse/QTBUG-101454
0:00 The problem: How to type Lukáš Tinkl when all you have access to is ascii?
1:26 Version 1: Preparing the combo box: Editing, filter, no insert, matching
4:03 The Model underneath
5:20 Version 2: Adding completion roles
6:13: QString::normalized()
8:45 The problem leading to version 3
9:20 Version 3: fix: pressing enter and tab - a work around
11:05 Printing out events
13:53 Debugging into Qt to understand the bug
17:47 Version 4: override pathFromIndex()
19:26 Version 5: Adding a validator
24:14 Do remember to compile your own Qt version
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI