C++23 is feature complete and on track to be released next year. While many people are complaining that it’s, after all, a “minor” release (as the pandemic made the Committee work very difficult), C++23 still has a few very significant changes. In this blog post, I want to talk about what I think is my […]
C++ Get the RSS Feed
Content related to C++
CXX-Qt Safe Rust Bindings for Qt
At KDAB, we have been investigating how to integrate Rust with Qt in a safe and idiomatic way. The solution we are currently working on is called CXX-Qt. It’s available in the GitHub and on crates.io. This blog post discusses the journey of CXX-Qt — where it started, where it can be used right now, […]
Loose Coupling with Signals & Slots Connecting (Almost) Any Function to a Signal
Here at KDAB, we recently published a library called KDBindings, which aims to reimplement both Qt signals and slots and data binding in pure C++17. To get an introduction to the KDBindings implementation of signals and slots, I recommend that you take a look at the KDBindings Getting Started Guide. It will give you an […]
Introducing KDBindings Reactive Programming and Data Binding in C++
All Qt developers should know about signals, slots, and properties. Those of you who have used QML will know that property bindings are super useful and cool. Bindings allow us to write more reactive and declarative style code. However, they are only available within QML, which means there are no compile time errors when you […]
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 […]