Introducing the kdalgorithms library, purposed to make it easier to work with algorithms in C++14 and up.
C++ Get the RSS Feed
Content related to C++
On QVarLengthArray and Uninitialized Storage in C++
If you’re following our Youtube channel you might have heard me talking about QVarLengthArray. If you’re not… you should follow us! But let me give you a quick recap. QVarLengthArray is a Qt container that acts like a vector; its elements are stored contiguously in memory and it has a dynamic size. At any time […]
C/C++ Profiling Tools
This blog will give you a brief overview of profiling C and C++ applications. Additionally, it will lay before you all of the tools available, with the purpose of aiding you in choosing the right tools at the right times.
CXX-Qt 0.4 Released
We just released CXX-Qt version 0.4! CXX-Qt is a set of Rust crates for creating bidirectional Rust ⇄ C++ bindings with Qt. It can be used to integrate Rust into C++ applications using CMake or build Rust applications with Cargo. CXX-Qt provides tools for implementing QObject subclasses in Rust that can be used from C++, […]
Understanding qAsConst and std::as_const
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 […]
C/C++ Debugging Tools An Overview of Debugging Tools for C and C++ Applications
In this blog on debugging and profiling, I would like to give you an overview of the debugging tools that exist for C and C++ applications. Automated Testing The first thing you need to do is make sure your code is properly tested. This, in itself, is not debugging, but it enables you to make […]
Fun with Paths and URLs in QML Managing Your QML Assets with Ease
There are a few small, and sometimes already quite old, features in Qt that, when combined, can be a very nice way to deal with assets in your QML application — especially if some of them live on the file system, some in a resource, and some may need localization or translation. Let’s dive in! […]
Structured Bindings with Qt SQL
Some time ago, I wrote a post about integrating Qt’s associative containers with the fancy new C++ features, range-based for loops with structured bindings. That post inspired KDAB’s own Giuseppe D’Angelo to add the asKeyValueRange member function to both QHash and QMap. Now it’s possible to iterate over them with a simple range-based for loop, […]
Say No to Qt Style Sheets Making the Right Choice Between QStyle and Qt Style Sheets, Upfront
You have two choices when it comes to giving a custom style to your Qt widgets. Qt Style Sheets are very convenient for getting started — just a few CSS-like rules, and they work. It is our experience, however, that Qt Style Sheets create too much trouble and a QStyle subclass (*) gives a better […]
JSONify All Things Extending the nlohmann/json Library
The nlohmann/json library is everything a developer can expect from a modern library — easy to integrate and JSON objects are treated as first class citizens with a very intuitive API. However, it has one problem that is widely mentioned across the internet, which I’ll tell you about below. Various solutions to the problem have […]