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
22 June 2026
When I ask Qt Creator to generate a new UI class for me, then it references the ui class via a raw pointer, rather than via a smart pointer. I asked Peppe (Giuseppe D'Angelo) if there were any value in me fixing this in all my code. As always, the answer was much more involving than originally anticipated, and very enlightening. Among other things we discussed why you still need to have the destructor implemented in the source file, despite it being empty.
00:00 Welcome
00:33 Isn't Qt Creator generating the wrong template for me?
01:46 Understanding the generated code
03:32 But shouldn't it be a unique_ptr?
05:39 but but but, the idea with a unique_ptr is that I need a destructor, so why do I need a destructor?
09:43 The empty destructor
12:04 The rule of five!
13:03 what does "=default" do?
13:47 Why not just have the Ui: Dialog on the stack?
Links:
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