Jesper K. Pedersen
292 results
Understanding C++ Type Traits
28 December 2022
Template code commonly uses type traits to test type properties: is it an l-value, is it const, does it have a method, etc. This episode investigates how type traits are implemented by creating our own versions of is_same_v, is_const_v, and integral_constant, building foundational knowledge for understanding complex template code like type comparisons and r-value detection.
Template Specialization in C++
20 December 2022
This video shows how to "overload" templates with two real-world examples: a sort function with general implementation plus char specialization, and a vector implementation with boolean specialization for space efficiency. Finally, we'll see how to make C++ reveal what type a template parameter represents.
A super fast intro to C++ templates
14 December 2022
In this episode we will start slowly understanding what a template is, but within 15 minutes we will have seen the assembly code generated, have discussed template type parameters and non-type parameters, and finally have discussed template template parameters (no that is not a mistake that it says template twice!)
Do Use C++ Algorithms!
7 December 2022
You have likely heard it before - "no raw for loops, use algorithms instead". In this episode, Jesper will give a few examples of code that became much cleaner when rewritten from raw loops to algorithms. Further, he will introduce an algorithm library he has written to make it much less painful to write code using algorithms.
Every now and then, when I submit some code for a code review, people tell me that I forgot qAsConst. Now I have one more enemy, namely: Clazy! It has also started saying this, and I guess it's about time for me to figure out what is going on. When do I need qAsConst and […]
Checking for Regression via Screenshots
18 October 2022
When making large code changes, you want to validate there are no side effects. While unit testing is ideal and Squish tests are good, both may be unrealistic. A "better than nothing" solution is running original and modified applications side-by-side and comparing them. This small application easily takes screenshots of each and compares them.
KDAB and Qt World Summit 2022
12 October 2022
KDAB will be Gold sponsors at this year’s free online edition of Qt World Summit on November 9th, 2022. Our very own Jesper Pedersen will present his talk “Highlights from Qt Widgets and More”. Don’t miss out! Join developers, designers, managers, and executives to get inspired by the latest developments with Qt. Register now and […]
Reading the Qt Source Code
6 October 2022
For a while, I thought Qt Creator's rename symbols and grep had a bug when they didn't find all occurrences. After filing a bug report, I learned it's actually a feature - you need to add all header files to CMakeLists.txt for it to work properly. This video shows how to fix your CMakeLists.txt files.
Improving My clang-tidy Checks
21 September 2022
Save Re-compile Time - Include moc Files in Source Files
14 September 2022
CMake's AUTOMOC runs moc automatically but compiles all moc files together, causing extensive recompilation when touching any Q_OBJECT header. Including moc files in .cpp files reduced recompile time from 22 seconds to 5 seconds. This episode includes a script to automate this plus a git hook to ensure you always include moc files.
QStringBuilder
7 September 2022
Which String Class in Qt Should I Use?
31 August 2022
Qt comes with lots of classes relating to strings these days, including QString, QStringView, QStringLiteral etc. It comes with so many that I lost track, so maybe it is time to call my good friend Peppe. In this episode we will discuss what you need to know to get it right at least 95% of the cases, without knowing it all.
Editing Delegates
24 August 2022
Qt Item Delegates - Some Real World Examples
17 August 2022
Qt Item Delegates - A Framework
3 August 2022
This episode completes the inline headers implementation by adding the required signal connections. It expands into class design discussion, showing how to create drop-in replacements for QTableView and QTreeView with row span support while avoiding code duplication through templated superclasses and private class inheritance.
Migrating to Qt6 - QVariant
19 July 2022
This episode discusses runtime QVariant issues encountered during Qt 6 migration of an in-house tool. Topics include debugging QVariant problems, using QVariant::fromValue for solutions, issues with QVariant::toString(), the removal of QVariant operator<(), using QVariant::compare, and improved Money comparison in both Qt 5 and Qt 6.
Mass Text Editing in Qt Creator
5 July 2022


