David Faure
54 results
Building Better Desktop Applications
11 September 2025
Building efficient desktop applications requires strategies that address common development bottlenecks. From reducing compilation times with precompiled headers, caching, and distributed builds, to mastering multithreading with sanitizers and safe structures, designing extensible plug-in systems, simplifying configuration via text-based files, and leveraging shared libraries for modularity - these best practices streamline development while boosting performance and maintainability.
This post explores implementing drag-and-drop onto existing items in Qt, such as moving emails between folders. It covers both Model/View and Item Widget approaches, detailing key setup steps and improvements made to Qt along the way.
In this follow-up to our drag-and-drop guide, we explore how to move items between views in Qt’s model/view framework. Learn how to set up both drag and drop sides, handle MIME data, and implement key model methods. Whether you're working with model/view separation or with item widgets, this post provides practical examples to help you customize UI interactions effectively.
This blog post is the first in a series on implementing drag-and-drop in the Qt model/view framework. It covers how to reorder items within a single view, whether you're using QListView, QTableView, or QTreeView with a custom model, or QListWidget, QTableWidget, or QTreeWidget with items. The post includes code examples, checklists, and insights into improvements made in Qt 6.8 for smoother drag-and-drop functionality.
To build parts of the code optionally, or to inject CMake variables into C++, you need pre-processor definitions like -DENABLE_FEATURE on the command-line or #define ENABLE_FEATURE 1 in code. This video shows 3 different ways of setting such pre-processor definitions with CMake. In addition, the video explains how and why you should use #if rather than #ifdef for on/off defines.
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 […]
Following these desktop software development best practices ensures a flexible design. This is crucial to the success of desktop applications.
In this video, you will learn about a common programming pattern called the job pattern, useful for asynchronous operations (for instance, driven by the Qt event loop) such as socket communication, or any other operation that emits signals upon progress and completion.
Six Tips for Maximizing Desktop Screen Potential
29 August 2024
Desktop software has many differences from mobile and embedded applications but one of the biggest and most obvious is the screen. How can you take advantage of all that real estate for your application? Six considerations for managing the screen in your desktop application Choosing the right GUI framework Use a flexible GUI framework that […]
Mastering Cross-platform Desktop Apps
15 August 2024
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. […]
In this video, you will learn how to debug a painting issue for a QWidget, using the detailed recording by GammaRay of all individual painting operations.
In this video, you will learn how to use GammaRay to find the slot executed by a QAction, when the user clicks on a menu item. This technique works even if you know nothing of the application code, all you have to do is find the action by its user-visible text.
In this video, you will learn how to use GammaRay to identify a context menu (QMenu) in a running application. The Pick Element feature won't let us see the context menu, but there are other solutions, like filtering for show events and finding the QWindow created for the menu.
In this video, you will learn how to use GammaRay to investigate the issue of a widget that can be squeezed down far too much horizontally. After testing the fix by changing a property dynamically at runtime, you will see how to find the corresponding line of C++ code in order to fix the bug for good.
In this video, you will learn how to use GammaRay to identify the widget responsible for a double margin issue, a frequent cause for misaligned widgets. After testing the removal of the margin in Gammaray, you will see how to make your IDE jump to the line of code that creates the widget, in order to find the corresponding layout and fix the bug there.
In this video, you will learn how to use GammaRay to visually select a widget in your Qt application, and from there find the class name of the widget, and make your IDE jump to the line of code that instanciated the widget.
This video introduces the series, defining the typical problems of Qt Widgets applications that we are going to try and solve using GammaRay.
This video shows how to implement a custom Qt widget, when none of the widgets provided by Qt match your needs. As an example, you'll be presented the code for a toggle switch, as is very common on mobile platforms, why not have something like that on the desktop too?
This video shows an example use of Qt stylesheets, to change the appearance of Qt widgets. We'll dig into the styling of the progressbar as example, the code for styling buttons is also provided.
This video explains the concept of widget styles, showing the code of an actual style written for this video. We'll dig into the styling of the progressbar as example, the code for styling buttons is also provided.