The goal When building C++ code with CMake, it is very common to want to set some pre-processor defines in the CMake code. For instance, we might want to set the project’s version number in a single place, in CMake code like this: This sets the CMake variable PROJECT_VERSION to 1.5, which we can then […]
Technical Get the RSS Feed
CXX-Qt 0.7 Release
We just released CXX-Qt version 0.7! CXX-Qt is a set of Rust crates for creating bidirectional Rust ⇄ C++ bindings with Qt. It supports integrating Rust into C++ applications using CMake or building Rust applications with Cargo. CXX-Qt provides tools for implementing QObject subclasses in Rust that can be used from C++, QML, and JavaScript. […]
10 Tips to Make Your QML Code Faster and More Maintainable Modernize your code for fun and profit
In recent years, a lot has been happening to improve performance, maintainability and tooling of QML. Some of those improvements can only take full effect when your code follows modern best practices. Here are 10 things you can do in order to modernize your QML code and take full advantage of QML’s capabilities. 1. Use […]
Implementing an Audio Mixer, Part 2 Basic DSP with Qt Multimedia
Recap In Part 1, we covered PCM audio and superimposing waveforms, and developed an algorithm to combine an arbitrary number of audio streams into one. Now we need to use these ideas to finish a full implementation using Qt Multimedia. Using Qt Multimedia for Audio Device Access So what do we need? Well, we want […]
Implementing an Audio Mixer, Part 1 Basic DSP with Qt Multimedia
Motivation When using Qt Multimedia to play audio files, it’s common to use QMediaPlayer, as it supports a larger variety of formats than QSound and QSoundEffect. Consider a Qt application with several audio sources; for example, different notification sounds that may play simultaneously. We want to avoid cutting notification sounds off when a new one […]
Mastering Cross-platform Desktop Apps
Creating applications for cross-platform compatibility is a modern best practice. It increases deployment flexibility and allows applications to reach a wider audience. However, doing it properly can involve some trial and error. At KDAB, we’ve built many multiplatform desktop applications. Here, we’ve compiled a few insights from that process to help you build better software. […]
More Ways to Rust
In our earlier blog, The Smarter Way to Rust, we discuss why a blend of C++ and Rust is sometimes the best solution to building robust applications. But when you’re merging these two languages, it’s critical to keep in mind that the transition from C++ to Rust isn’t about syntax, it’s about philosophy. Adapting to […]
Formatting Selected Text in QML Quasi-Backporting Qt 6.7 QML cursorSelection to Older Versions
Motivation Let’s say we’re working on a QML project that involves a TextEdit. There’s some text in it: here is some text We want to select part of this text and hit ctrl+B to make it bold: here is some text In Qt Widgets, this is trivial, but not so much in QML – we […]
Behind the Scenes of Embedded Updates
An over-the-air (OTA) update capability is an increasingly critical part of any embedded product to close cybersecurity vulnerabilities, allow just-in-time product rollouts, stomp out bugs, and deliver new features. We’ve talked about some of the key structural elements that go into an embedded OTA architecture before. But what about the back end? Let’s address some […]
Using Nix as a Yocto Alternative Building a bootable Linux image from the ground up in a declarative way
Building system images for embedded devices from the ground up is a very complex process, that involves many different kinds of requirements for the build tooling around it. Traditionally, the most popular build systems used in this context are the Yocto project and buildroot. These build systems make it easy to set up toolchains for […]