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
24 August 2022
In the previous two episodes we looked at Qt's support for rendering items in the model/view framework. In this episode we will turn our attention to custom delegates for editing items. In the KDAB gift shop we will receive a ready to use delegate for choosing items with a combo box.
0:00 Introduction
1:28 Setting up a simple delegate for editing Money values
6:52 QItemEditorFactory
11:02 Now I can't edit booleans - time to start t he debugger
12:50 QWAMItemEditorFactory
16:34 Unfortunately the concept didn't work out for me
17:34 QComboBoxDelegate
19:35 Subclasing QComboBoxDelegate to support custom types
22:22 Using std::variant
23:41 Ensure data is committed as soon as I've selected an item in the combo box
27:37 Outro - a few jokes
The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/EditingDelegates
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI