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
15 April 2025
Qt has two kinds of lists, tables, and trees. One kind uses a model/view setup which gives a great separation between data and presentation. The other one is item based, meaning your data is stored in the items, just like the checked value is stored inside the checkbox.
The disadvantage with the model/view framework is that it is more work to set up, which is why we will start this module with the much simpler item based version.
Chapters:
00:00 Introduction
00:45 The Widget versus the View classes
03:55 QListWidget
08:40 QTableWidget
10:16 The table widget example
15:47 Advertise - can you help us with a USB driver?
16:11 QTableWidget::addItem - of course doesn't exist
16:55 QTreeWidget
20:35 The tree widget example
24:00 Compare the API of list, table, and tree
24:35 Configuring items
27:00 Headers
29:06 Whats up in the next episode
Links:
* Table View Galore : https://youtu.be/F8min4ZZJaI?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
* Episode on Resources: https://youtu.be/BIES4pOVtz8?list=PL6CJYn40gN6iFcTyItvnE5nOmJR8qk_7o
The example code showcased in this video is available here:
https://github.com/KDABLabs/kdabtv/tree/master/Programming-With-Qt-Widgets/modelview
All 'Introduction to Qt Widgets - Module 1' videos: https://www.youtube.com/playlist?list=PL6CJYn40gN6hgf7zCKF2Rv9Y0WoN8RVGf
All 'Introduction to Qt Widgets - Module 2' videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6j_c41CFMprvg9EiWz0WdSy
All 'Introduction to Qt Widgets - Module 3' videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6hWZO_viEf1rfjgk4E6SCKd
All 'Introduction to Qt Widgets - Module 4' videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6iXUNQMb2GkEjV_oK6Xid9-
All 'Introduction to Qt Widgets - Module 5' videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6h1tsLAETdrrFlsVMeYpiHI
All 'Introduction to Qt Widgets - Module 6' videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6jIsRYriqN70V83t_mdDZHT
All 'Introduction to Qt Widgets - Module 7' videos: https://www.youtube.com/playlist?list=PL6CJYn40gN6hHyqD9ZxUqpd14LoHvadN7
All 'Introduction to Qt Widgets - Module 8' videos: https://www.youtube.com/playlist?list=PL6CJYn40gN6iCb8g5NSfVqX0JRFzFnxak