Keyboard navigation and the event system

Keyboard navigation in a GUI application might not be the most highlighted feature. Most devices use clickable or touchable controls in the user interface to change screens, open menus or activate buttons. Many developers don't even bother looking at the problem because the customers might not ask for it. But if said application is intended for a device that doesn't have other kind of input, or you have to satisfy some accessibility requirements, it's definitely something that will end up being the feature that blocks a release if it has some known bug. First we will cover some interesting details of Qt's event system, and then we will move to the details that you should know for providing your UI with a good keyboard navigation system.

Read More

How to use QThread properly

There are basically two different ways of using QThread directly: Worker threads or subclassing. Those two are confusing to a lot of developers, and I will try to explain when you should use those. I will also explain how signals and slots work with threads and how they can help you or lead to problems.

Read More

Serializing/deserializing a QObject tree

A while ago I wanted to implement save and load for an application. The application model was a QObject derived class, with a bunch of sub (-sub) classes. As the UI was QML, everything was accessible through properties. Instead of writing a save and load mechanism for every single class, I was able to write one generic save load mechanism. This can be done using QObject introspection/reflection. So the class name, properties and member functions can be queried.

Read More

Xml/Json Comparison

Recently I needed to implement a client application that would fetch data from a web service. The client had to be written in C++ using the Qt 5.4 libraries, the server was already running Apache2 with php 5.something but the …

Read More

Building Qt 5.4 on Windows

In this blog post I will go through the process of building a 32 bit Qt 5.4 with OpenSSL support on Windows. I will use Windows 8.1 64 bit and Visual Studio 2013, but there should only be minor things …

Read More

QWidget Pixel Drawing

In very rare occasions, we want to draw individual pixels all over a widget. Custom painted widgets are much less common. But we can often get away with much easier painting than doing individual pixels. We draw these using lines, …

Read More

Encapsulation in QML Components

In QML, it’s so easy to use properties of components directly, and it’s even the way most examples do it. But here’s my quesion: If we consider this the wrong approach in C++, isn’t it wrong in QML as well? …

Read More

QObject SignalBlocker

Sometimes you have to stop a class from emitting a signal for a while. One example that just came up on the Qt interest list was an application that modifies a file which it also monitors with a QFileSystemWatcher. You …

Read More

Implementing tool tips in QML

If you are using the Qt Components, you have tool tips available. But with the standard SDK, you’re on your own. Here, I’ll implement a simple tool tip component for you. In my application, I have a lot of Text …

Read More