Jesper K. Pedersen
282 results
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
The C++ Explicit Keyword and Qt
28 June 2022
This episode explores C++'s explicit keyword: why there's no implicit keyword, why it's needed for QObjects, and available tooling. Topics include implicit conversions in string classes, when conversions go wrong, explicit to the rescue, named constructors, QObject-specific issues, Q_IMPLICIT, explicit(false), clang-tidy support, and rules for when implicit conversions are acceptable.
This episode completes the proxy model for reversing rows by handling the challenging layoutAboutToBeChanged signal. It covers understanding QModelIndex, updating persistent model indexes, layoutAboutToBeChanged and layoutChanged signals, and why persistent index updates differ for other operations like rowsInserted.
Git Switch and Restore
1 June 2022
What Did That Macro Expand to?
4 May 2022
Subclassing isn't always the solution!
20 April 2022
No More Booleans!
14 April 2022


