KDAB_Tree_Header_Mobile KDAB_Tree_Header_Web

Trusted Software Excellence since 1999

Jesper K. Pedersen

278 results

In the previous episode, Jesper presented a new delegate super class, namely QWAMDelegate. In this episode, he demonstrates three use cases for delegates showing a “progress bar”, HTML, and an amount, an arrow and a percentage change.

QListView, QTableView and QTreeView can all be configured via a number of roles from the models, e.g. BackgroundRole, ForegroundRole, FontRole, and TextAlignmentRole. This often means that no additional configurations of the views are needed.

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.

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.

This episode shows a specialized combo box for solving this simple problem:

Efficient software developers avoid repetitive tasks by using tools like Perl, Python, or Bash on source code outside their IDE. Qt Creator offers macro recording facilities that, combined with block commands, can handle many such tasks.

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.

One of the most complex things in Qt's model/view framework is the implementation of proxy models.This episode shows an almost complete implementation of a proxy model which reverses its rows but, at the same time, also gives hints for where and when you can cut corners.

This episode introduces "git switch" and "git restore" -- two commands, which means that, in most cases, you do not need "git checkout" anymore.

Do you remember to add qAsConst around Qt containers when iterating? Without it, containers risk detaching just before iteration starts. This episode explains what qAsConst does, why and when it's needed, and how to handle iterating containers returned from function calls.

Jesper explores the smoothest way to implement operator<() for custom classes, journeying through std::tie() and std::tuple(), ending with a discussion on QString comparison considering human interpretation.

Your compiler likely parses nearly 100,000 lines of code for a simple Qt "Hello World!" program. This episode shows how to see exactly what code is given to the compiler for each source file you compile.

Using integers and strings for user IDs, project IDs, and names risks confusion between different types, with compilers unable to catch these errors. This episode shows a wrapper class to make these types unique and discusses Qt integration.

Developers with Java or C++98 backgrounds often default to subclassing when facing problems. Modern C++ offers many different solutions, and this episode demonstrates when subclassing isn't the right approach.

Designing API's is hard work with lots of traps. Even worse is the situation when you later maintain the code and just need a function to behave slightly different in different situations.

Complex applications display lots of information, making it difficult to find layouts that work for every user. KDDockWidgets provides flexibility by letting users reorganize, save, and restore their custom layouts to meet different needs.

In Qt Creator, there is a line edit which has a push button embedded in it for selecting tokens. How did they do that? In this episode, I'll investigate and implement a file chooser based on this idea.

Whether you've just finished watching our 54 "Introduction to Qt/QML" videos or you are just looking for QML tips and tricks, here are 35 more videos that can help you save time and increase your productivity. So check out our Qt Creator tips, our git tips, and much more!

Qt DevCon was a conference for the Qt developer community and focused exclusively on developer topics. It took place place in Berlin, Germany from 14th to 15th June 2022.

JesperKjaerPedersen

Jesper K. Pedersen

HR Director / COO