In a well-designed QML application, the UI is built using re-usable components, while the data and logic live in C++ based components we call controllers here. The QML part of the application uses these components (that themselves may be written in QML or C++) to build up the user interface and connect these components with […]
Blog Archives
KDFunctionalSortFilterProxyModel A Functional Sort/Filter Proxy Model
Another day, another small addition to KDToolBox, KDAB’s collection of miscellaneous useful C++ classes and stuff. In this post, we’re going to talk about KDFunctionalSortFilterProxyModel, which is a convenience subclass of QSortFilterProxyModel. What’s a proxy model to begin with, and what’s QSortFilterProxyModel? Well, that explanation requires a bigger space than what I have in this […]
VS Code for Qt Applications – Part 3 A Technical Guide
This 3-part blog series shows in detail how to get up to speed with a Qt project using Visual Studio Code. Part 3 further integrates Qt into VS Code with syntax highlighting, Qt Creator quick switch and more…
The cmake-project Script Generating a CMake Project For a Single Executable in C++
If you ever need to create a project around a single C++ file (or just a few C++ files) in CMake, as you might for quick test cases, you might find it tedious to write a CMakeLists.txt file by hand every time. To make this easier, I’ve written a script called cmake-project that you can […]
Fast Duplicate Tracking DuplicateTracker Merged to KDToolBox
In 2019, I optimized QStringList::removeDuplicates() by using std::pmp::unordered_set with a std::pmr::monotonic_buffer_resource, when available. The class that I wrote to encapsulate this optimization has since been re-implemented three times. The latest iteration has recently landed in KDToolBox. If you have code that looks a bit like this: then you should read on.
Improving C++ Development in Visual Studio Code with compile_commands.json and Bear
As described in our previous blog posts, you can use Visual Studio Code as an IDE for C++ projects. It works particularly well with CMake-based projects. Unfortunately, with build systems not supported natively by VS Code, you need to manually configure include paths and compilation definitions, for the code model to work properly. Since the […]
On the Removal of toSet(), toList() and Others or "How Do I Convert a QList to QSet in Qt 6?"
(Apologies for the clickbait in the post title! But I’d really like people who are searching for solutions to read this.) Between Qt 5.14 and Qt 5.15, my colleague, Marc Mutz, and I submitted a series of patches to Qt that added “range constructors” to the Qt containers. This brought Qt containers one step closer […]
New in Qt 6.1: std::hash Support for QHash
In the previous blog post of this series, we discussed KDToolBox::QtHasher, a helper class that allows us to use unordered associative containers datatypes which have a qHash() overload but not a std::hash specialization. The majority of Qt value classes indeed are lacking such a specialization, even if they do provide a qHash() overload. For our […]
Can’t the Compiler Do That? Customized C/C++ Tooling with Clang LibTooling
Note: This is the English translation of the article first published in German Intro The ESE Congress is one of the lead events for Embedded Software Engineering in Germany. This year it was held digitally for the first time, so that participation was also possible via video. Over five days, there were 3 keynotes and […]
Signal/Slot Connection Throttlers
Another day, another blog post about KDToolBox, KDAB’s collection of miscellaneous useful C++ classes and stuff. Today, we’ll talk about ways to throttle your signal/slots connections — in other words, how to activate a slot less often than the emission rate of the signal it’s connected to. The usual reason why you may want something […]