Qt Custom Event Handling: Creating and Dispatching Custom Events
Qt enables the creation of custom event classes that must inherit from QEvent. Each custom event class requires a globally unique Type value (retrievable via event->type()) and a corresponding event handling method in the application.
Creating a Custom Event Class
To create a custom event class:
Inherit from QEvent.
Define a globally unique ...
Posted on Fri, 29 May 2026 22:04:26 +0000 by NoPHPPhD
High DPI Adaptation Strategies for Custom Qt Pie Charts
Implementing DPI Awareness in Custom Widgets
Modern desktop application development demands robust support for high-resolution displays. Ensuring consistent visual fidelity across standard 1080p monitors and 4K screens is critical for user experience. This guide details the architectural approach to adapting custom Qt widgets, specifically focu ...
Posted on Fri, 29 May 2026 21:28:26 +0000 by d_barszczak
Button Widgets in Qt for C++ GUI Development
QPushButton
QPushButton is derived from QAbstractButton, an abstract base class for all button types.
Property
Description
text
The label displayed on the button.
icon
An icon shown on the button.
iconSize
Dimensions of the icon.
shortcut
Keyboard shortcut to trigger the button.
autoRepeat
If true, holding the mouse button trigge ...
Posted on Wed, 27 May 2026 16:15:37 +0000 by RedMaster
Comprehensive Guide to Common Qt Widgets and Layouts
Layouts and Spacers
Grid Layout arranges widgets in a grid of rows and columns. Each widget can span multiple cells.
#include <QApplication>
#include <QWidget>
#include <QGridLayout>
#include <QPushButton>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QWidget window;
QGridLayout layout;
...
Posted on Tue, 26 May 2026 19:57:27 +0000 by tharagleb
QRowTable Table Control (IV) - Efficiency Optimization: Optimizing Data Sources
Light-hearted Moment
A programmer's first time visiting his girlfriend's parents, her mother asks him: "If you want to marry my daughter, how much savings do you have?"
The programmer looks down and says: "Five hundred!"
Her mother scoffs: "Only five hundred? Not even enough to buy a toilet!"
The programmer quic ...
Posted on Fri, 22 May 2026 21:42:54 +0000 by legohead6
Implementing Irregular Shape Hit Testing in QML with Alpha Masking
Standard QML MouseArea components are rectangular, which often poses a challenge when designing interactive UI elements with complex shapes, such as circular buttons or organic illustrations. To achieve precise interaction where clicks are only registered on the visible parts of an image, we must extend QQuickItem in C++ to implement alpha-base ...
Posted on Wed, 20 May 2026 16:30:02 +0000 by AbiusX
Understanding Qt Window Components and Window Types
Window Components in Qt
Graphical user interfaces (GUIs) in Qt are built using a hierarchy of windows and widgets. The <QtGui> module provides the foundational classes for creating these UI elements, and all visual components are represented as objects derived from the QWidget class.
The Role of QWidget
QWidget serves as the base class fo ...
Posted on Wed, 20 May 2026 01:51:58 +0000 by Mykasoda
Effective Qt Threading: Encapsulating Worker Logic with QObject::moveToThread
Developing responsive Qt applications often requires offloading long-running or periodic tasks from the main thread. This separation prevents the user interface from freezing and ensures a smooth user experience. Qt provides QThread for managing threads, and QObject::moveToThread as a robust mechanism to execute QObject-derived operations in a ...
Posted on Tue, 19 May 2026 20:56:31 +0000 by miligraf
YUView: Open Source Tool for Viewing YUV and RGB Raw Video Data
Overview
When developing audio and video applications, working with raw YUV and RGB image data files is a common requirement. YUView is an open-source application that provides a robust solution for inspecting these raw data formats. The tool runs on multiple platforms including Linux, Windows, and macOS, making it particularly valuable for dev ...
Posted on Tue, 19 May 2026 13:28:10 +0000 by musicbase
Resolving Cross-Compilation Issues with Qt on Linux
Installing Cross-Compilation Toolchain
# Install ARM cross-compilation tools
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
# Alternative: Download toolchain from vendor
wget https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux ...
Posted on Tue, 19 May 2026 09:15:39 +0000 by mizkie