Articles posted by the author:

In this final installment of our Qt Developer's Bag of Tricks series, I'll look at some helpful tools that didn't fit into any of the categories covered previously.
GammaRay
GammaRay (1) is a tool for examining and manipulating the internals of Qt applications at run time. Unlike conventional debuggers, it understands the implementation of Qt, allowing it to visualize application behavior at a higher level, including signals, slots, properties and even scene graphs, model/view and state machines. It is free software, licensed under the GPL. A screen shot is shown below,...

Computer software sometimes has a requirement for generating random numbers. Applications include games, simulations, cryptocurrency, and security software. Generating true random numbers is surprisingly difficult, and many applications use a series of pseudorandom numbers, sometimes seeded with an initial value that is not constant, such as user input or the current time or date.
The ISO standards for the C and C++ programming languages and other standards, such as POSIX, define standard random library functions. The most well-known are probably the rand() and srand() functions.
Since...

While you can develop software using just a text editor and the command line (and many people do), you'll often see productivity gains by using a graphical integrated development environment (IDE). Here are a few options for IDEs that are suitable for Qt development.
Qt Creator
The "official" Qt IDE, Qt Creator (1) is open source, cross-platform, and written using Qt. It is usually the IDE of choice for Qt development unless you have some special requirements or a personal preference. Its support for mobile and embedded platforms really pays off in making it easy to build, deploy,...

Various tools that can be lumped together under the category of simulators and emulators can be useful during development, especially for embedded systems. A number of products use virtualization to run one operating system on top of another one. This allows you to run Linux on top of Windows, for example, or vice versa.
This is often useful for embedded development where you might want to develop on a Windows desktop, but need to run a cross-compiler or SDK that is only supported under desktop Linux.
Virtualization allows you to run Linux in a virtual machine under Windows, and still...

As 2017 draws to a close, I'd like to take a look back at some of the significant events of the past year that are relevant to the Qt framework and the ecosystem around it.
Qt Releases
The Qt Project continued to follow the process of generating two minor releases per year. Qt 5.9.0 was released on May 31, with subsequent patch releases for 5.9.1, 5.9.2, and 5.9.3 during the course of the year.
Note that the 5.9 series is a Long Term Support (LTS) release, with a promise of support for three years. The previous LTS series was 5.6, which is still being supported. The current...

In the past, embedded systems often ran very small operating systems with no filesystem, or even ran on the "bare metal." With the increasing power and lower cost of hardware, including SOCs (Systems on a Chip), many embedded systems are moving to a full operating system, often based on Linux.
One advantage of running Linux on an embedded device is that many of the tools and utilities you are familiar with on a desktop Linux system are available in this environment, as well. While the final product may not ship with them, as a developer you can have access to a shell, basic commands,...

Memory and resource leaks are the stuff of nightmares for programmers. If a program doesn't properly free memory or other resources, it may appear to run correctly, but randomly crash or misbehave after working normally for hours or days. All too often, the problem is only discovered just before the application is supposed to be shipped to customers.
While Qt helps somewhat with it's object model, resource leaks can occur with any programming language like C++ where the user is responsible for managing memory or other resources like file handles. Let's take a look at some of the tools that...

Static Analysis (1), or more correctly, Static Program Analysis, is a method of analysis of computer software that is performed by examining source code without actually executing it. It is typically performed by automated tools.
Static analysis is increasingly used in the development of safety-critical software, such as medical, nuclear and aviation systems. In this installment of our series on software development tools, today we look at some options for static analysis, focusing on those that support C++.
CppCheck
Cppcheck (2) is a static code analysis tool for the...

An interesting feature coming in Qt 5.10 is a new Qt back end that uses WebGL for rendering. It allows Qt applications (with some limitations) to run in a web browser that supports WebGL.
What Is it?
The new back end uses WebGL, which stands for Web Graphics Library. WebGL is a JavaScript API for rendering 2D and 3D graphics within any compatible web browser without the use of plug-ins. The API is similar to OpenGL ES 2.0 and can be used in HTML5 canvas elements.
The new back end will be introduced as a technical preview feature in Qt 5.10.0 and is included in the Alpha and...

Continuing our Qt Developer's Bag of Tricks series, this time I'll give you an overview of some applications that come under the general category of tracing. (I'll also include some test coverage tools here too since they don't fit in any other categories in this blog series.)
Tracing is often an effective and efficient debugging technique that doesn't require as much effort as using a debugger. It can be particularly useful for programs that you didn't write and don't have source code for. If a program crashes or hangs, tracing it may quickly identify the cause of the problem....

Developers often have a desire to speed up their code to make it run more quickly. Some well-known advice on this topic, attributed to the programmer Michael A. Jackson, says:
Rules of Optimization:
Rule 1: Don't do it.
Rule 2: (for experts only) - Don't do it yet.
Sometimes a third rule is added:
Rule 3: Profile before optimizing.
The key point here is not to optimize your code until you have a correct, clearly written, and unoptimized solution. Then, use tools to identify where the bottlenecks are and focus on them. Software performance often follows a so-called 80/20 rule where...

Experienced software developers tend to build up a set of tools that they find indispensable for development, testing and debugging. But if you ask a group of developers what their "go to" tools are for various tasks, it is surprising how different the answers can be. I've also found that many developers are unaware of some very useful tools that can save hours of effort.
In the Qt Developer's Bag of Tricks series, which kicks off with today's post on debuggers, I'll cover several tools that the development team here at ICS has found useful.
Scope
Software...

Since my last update there have been some new happenings in the Raspberry Pi community. Here's a look at a few of the most significant events.
Raspberry Pi Zero W
[Photo credit: raspberrypi-spy.co.uk]
In late February 2017 the newest Raspberry Pi model was announced: the Raspberry Pi Zero W. Though similar to the previously released Raspberry Pi Zero, the W model adds WiFi and Bluetooth functionality. The retail price is US$10, higher than the $5 Raspberry Pi Zero, but still significantly less expensive than the $35 Raspberry Pi 3 Model B.
I recently purchased...

In this post we'll take a look at one of the newer Qt modules: Qt Speech.
What Is Qt Speech?
Qt Speech is a module providing cross-platform support for text to speech. It supports text to real-time speech output. Common use cases for text to speech include enabling software for visually impaired users and scenarios where users cannot utilize a touchscreen, mouse, or keyboard input, such as in-vehicle applications. The module may support other features, such as speech recognition, in the future.
The Qt Speech module was first introduced in the Qt 5.8.0 release. As of Qt 5.9.0 it...

In previous blog posts I've covered how to configure Qt Creator for development on Linux (1), Windows (2) and MacOS (3) desktop systems and for embedded development on the Raspberry Pi (4).
We're often asked in our training classes and consulting projects how to set up the Qt Creator IDE for embedded development using the Yocto (5) framework.
In this post I'll discuss how to do this, including instructions covering how to build a Yocto toolchain with Qt if you don't already have one from your hardware vendor.
Prerequisites
Development for Yocto is normally done on a Linux desktop...

The Windows Subsystem for Linux (WSL) is a new feature of Windows 10 (1) that allows you to run native Linux programs directly on Windows, alongside other Windows applications.
When WSL is enabled, it installs an Ubuntu user-mode image that was created by Canonical, the company behind Ubuntu Linux. It loads and runs the Linux Bash shell and provides many of the command-line tools that you would expect when running Ubuntu Linux. It is based on the Ubuntu 14.04.5 LTS release.
Installation
It is easy to install. (2, 3, 4) Turn on developer mode and then enable the Windows Subsystem for...

Two earlier blog posts (1) (2) covered how to set up Qt and Qt Creator on Windows and Linux systems. Let's look at installation on the remaining major desktop platform, macOS.
Thanks to the unified Qt installer, the process is very similar to that on Windows and Linux, so we'll just cover some of the differences and highlights of the Mac install.
Assumptions and Prerequisites
For this example we'll install Qt 5.7.1, which is supported on macOS version 10.8 and later.
The C++ compiler used by Qt on macOS is the Clang compiler, provided as part of the Xcode development tool....

In an earlier blog post (1) I described how to create a widget with a Qt Designer plugin interface so it can be viewed within Qt Designer. With the increased interest in using Qt from the Python programming language, I asked one of our developers to reproduce the same example, but implement the widget in Python with PyQt.
Not all the steps to do this are obvious so I'll walk you through.
Example Files
The download link (2) contains the example code referenced in this blog post. It includes the following source files:
ledwidget.py: A port of...

Happy New Year!
In previous blogs I have covered installing Qt and Qt Creator on Windows and on Linux using the Qt installer and pre-built binaries. In this post, aimed at developers with novice-level Qt skills, we'll look at how you can build Qt yourself from source code.
Rationale
Why would you want to build Qt from source? While the downloadable pre-compiled binaries are convenient and save time, you may want to build Qt using a different configuration from that provided by The Qt Company. You may, for example, want to enable or disable different options...

As 2016 draws to a close, I'd like to take a look back at some of the significant events of the past year that are relevant to the Qt framework and the ecosystem around it.
Qt Releases
Starting in 2016, Qt 4 was officially at end-of-life status and no longer supported. The last release was Qt 4.8.7 in May 2015 and no new releases are planned.
This past year introduced the first long-term support (LTS) release of Qt, following the model of some other open source projects like Ubuntu to make a commitment to support a release for five years. Currently, this is the 5.6 series with the...

I've just returned from the Qt World Summit conference and wanted to share a brief report on some of the highlights of the show. Held from October 18-20, 2016, this was the 13th annual Qt developer conference and the second under the banner of the Qt World Summit.
This year the summit was held at a prime location: the Pier 27 San Francisco Cruise Ship Terminal, which features a breathtaking view of the San Francisco Bay next to the Bay Bridge, and only is a short distance from attractions like San Francisco's famous Pier 39.
The conference followed a similar...

My recent blog post covered how to set up Qt and Qt Creator on a Windows 10 system. In this post I'll look at how to configure a Linux system for Qt desktop development.
Since the set up process on Linux is almost identical to that on Windows, rather than repeat the information I refer you to that blog. (Keep it handy, you'll need it later.) In this post, I'll cover the differences.
Assumptions and Prerequisites
For this example I will assume you want to install Qt 5.6.0 or 5.7.0 on a recent release of Ubuntu Desktop Linux. The procedure will be similar with other...

Feedback from our recent Qt for Beginners webinar series indicated a need for some basic tutorials for beginners. If you struggle with initially getting Qt set up for development with the Qt Creator IDE and a C++ compiler, this post is for you. I'll walk you step by step through the process of getting a Qt development environment running on Windows, providing lots of screen shots to guide you.
Assumptions and Prerequisites
For this example I'll assume you are running Windows 10. We will install the Open Source version of Qt 5.7.0 using the MinGW C++ compiler and the Qt...

I've mentioned the Yocto (1) embedded framework in previous blog posts. Some people may have shied away from trying it because they have heard it has a steep learning curve. While Yocto is complex, it is very easy to get started and you can do so without any embedded hardware.
In this post I'll present a series of step-by-step instructions for building the Yocto-based Poky Linux distribution and running it under the Yocto emulator. The build environment will be Ubuntu desktop Linux but it should work much the same on any desktop Linux system. I've tested this on an Ubuntu 14...

Integrated Computer Solutions (ICS), a leader in Qt consulting, custom software development and user experience design, is proud to offer four tactical pre-conference training courses on October 18th at the 2016 Qt World Summit in San Francisco. Whether you’re new to Qt or a seasoned Qt developer, you’ll come away with actionable insight and fresh skills you can use to build compelling products and deliver engaging user experiences.
Join us for one of these informative sessions:
State-of-the-Art OpenGL and Qt
Did you know that virtually all embedded platforms...

While much attention has been focused on the built-in WiFi hardware, the Raspberry Pi 3 (1) also ships with on-board support for Bluetooth. Bluetooth is a wireless technology for exchanging data over short distances using 2.4 GHz radio signals.
When running the recommended Raspbian Linux distribution, the Raspberry Pi uses the standard Linux Bluetooth software stack called BlueZ (2). Qt's Bluetooth module (3) on the Linux platform also supports BlueZ, which means that it works on the Raspberry Pi.
Following the procedure in my recent blog post (4) to build Qt will provide support...

Qt Gamepad is a Qt module that supports the use of gamepad hardware. Gamepad is the term used to refer to input devices with buttons, directional controls (which may be digital joypads or analog joysticks), and sometimes keys for keyboard input. Used on video game consoles, they are also available for personal computers. (They typically connect using a USB interface.)
The Qt Gamepad module is new in Qt 5.7.0 and provides both QML and C++ interfaces. It is considered a tech preview release in Qt 5.7.0, which means that the APIs are still subject to change in the future.
The module...

While it is not the only option, Qt Creator is the integrated development environment (IDE) of choice for Qt. It provides good support for developing for embedded systems, including cross-compiling, deploying to a target system, debugging and profiling. It's free, well documented (1), and actively developed.
Configuring Qt Creator for embedded development is sometimes a stumbling block for our Qt training students and consulting customers. In our recent Qt For Beginners webinar series (2) it was suggested we present detailed instructions showing how to...