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
20 April 2022
If you have a Java background, a C++98 background, or similar, your finger memory may reach for the subclassing tool in your toolbox whenever you face a problem.
In modern C++, there are many different ways to solve problems and, in this episode, I'll show an example where subclassing indeed isn't the right tool.
0:00 Intro
0:20 Intro to the problem
0:45 My starting point
2:03 Version 2 - encapsulating the currency sign in a class
4:32 version 3 - adding a virtual method for setup
5:26 version 4 - replacing the classes with functions
The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/chart-axes
All QML tips and tricks videos : https://www.youtube.com/playlist?list=PL6CJYn40gN6jWHP5krsQrVGyYtKh3A3be
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI