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
8 June 2023
In this episode, I'll polish the custom context menu adapter code from last week to get rid of the unique_ptr's - I got inspired for that, from reading about type erasure.
And, I'll also explain the C++ mix-in pattern that allows me to override the contextMenuEvent() method.
Segments:
0:00 Introduction
0:29 Recap of last weeks episode
1:21 The problem with last weeks code
2:55 CustomContextMenu::Adapter as a mix-in
4:22 Two philosophic advises for life.
5:08 Up for improvement: std::make_unique<Action>
6:18 Solution - value classes - inspired by type erasure
7:42 Now the code without pointers
10:03 The code on the call site
10:51 Reflection over my own learning in this episode
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI