A Combo Box Which Completes UTF-8 as ASCII
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
About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.
The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/AsciiComboBox
Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/
About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more. https://www.kdab.com/software-services
KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.
Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/
We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/
Видео A Combo Box Which Completes UTF-8 as ASCII канала KDAB
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
About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.
The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/AsciiComboBox
Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/
About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more. https://www.kdab.com/software-services
KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.
Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/
We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/
Видео A Combo Box Which Completes UTF-8 as ASCII канала KDAB
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Deploy: Faster!Starting the Application in GammaRay from Qt CreatorIntroduction to Qt Widgets (Part 20) - Common WidgetsHeader Spanning Multiple ColumnsTesting QAbstractItemModels on the FlyKUESA 3D Studio Designer Workflow - Part 2Show Me Your IDE: VSCodeEmbedded World 2020: Which Qt Version would you recommend for the Windows CE 6.0 Platform?KDAB News 10/2021 - Topics: Qt 6 and 3D - What's New?; KD Bindings for C++; KItemModels and moreKDAB Training Day 2023Inter-process Communication with Qt: Implementing a REST Client Using QNetworkAccessManagerKDAB News 02/2024 - KDE Plasma 6 Release; KDAB at EWN24, New codebrowser Libraries; Oxidize and moreGammaRay: Taking a deep look into your Qt application - Volker KrauseUsing Bookmarks in Qt CreatorQTDD14 - Closing the Gap between Qt/QML & Android/iOS - Alex LeutgöbGammaRay Tutorials (Part 2) - How to set up GammaRay on WindowsKDAB News 5/2021 - Insights into C++20 with Ivan Čukić; Qt 6.1 released; Qt DevCon 2021 in BerlinQt 3D: integrating 3D into user interfaces–Giuseppe D'Angelo, KDABHow to Add a Button to the Corner of a DialogFlutter on TI AM6254