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
26 July 2022
In a previous episode on inline headers in tables and trees, I left on a cliff hanger saying, "and then you need to connect to some change signals from the models."
I'll make things right in this episode by implementing those signals.
HOWEVER, I won't stop there, I'll continue with some discussion on class design, and how to avoid duplicating code for setting up a table view and a tree view.
0:00 Introduction
0:40 The original code
2:14 The basic idea - a drop in replacement for QTableView and QTreeView with row span support
2:51 Step 0 - Basic implementation
3:42 clazy warning
4:04 Step 1 - Signal connections
9:01 Step 2 - Introducing the superclass RowSpanHelper
14:57 Step 3 - RowSpanHelper as a templerized super class
18:48 Step 4 - subclassing from a private class
22:58 Step 5 - Implementing the template methods in C++
Links:
Original video explaining the table rows https://youtu.be/qLnX_yfSZAU?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
Episode on clang-tidy and clazy: https://youtu.be/gO3KCzdmcrQ?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
Here is why you should always include the Q_OBJECT macro: https://youtu.be/KkJfkrIO29Y?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI&t=279
The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/InlineHeaders
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Learn Modern C++
Our hands-on Modern C++ training courses are designed to quickly familiarize newcomers with the language. They also update professional C++ developers on the latest changes in the language and standard library introduced in recent C++ editions.
Learn more