After 5.8 reduced startup times with its QML compilation caching, object creation remains one of the largest startup time consumer for Qt Quick applications. One can use Loaders to avoid loading parts of the application that are not currently visible, but some scenes with higher complexity can still be taking quite some time to initialize when they urgently need to be displayed, especially on embedded systems.

At QtCon 2016 Andrew Knight presented a few benchmarks showing a situations where C++ can improve Qt Quick object creation times over QML. A conclusion of the session was that those benchmark results would need to be taken with a grain of salt since the specific benefits could be smaller in a real application relatively to everything else happening around.

What we’re presenting today are results of converting parts of a well-known QML example to C++ using public and private APIs, measuring the improvements on loading and execution times to have a better estimate of the opportunity for real world applications.

In Qt 5.0 already, QMutex got revamped to be fast. In the non contended case, locking and unlocking
is basically only a simple atomic instruction and it does not allocate memory making it really light.
QReadWriteLock however did not get the same optimizations. Now in Qt 5.7, it gets on par with QMutex.

When you pass a name to
QIcon::fromTheme,
Qt needs to look up in the different folders
in order to know which theme contains the given icon and at which size. This might mean a lot
disk access needs to be done only in order to find out if the file exists. Applications such as
KMail can have
hundreds of icons for each of their menu actions.
In the KF5 port of KMail, 30% of its start-up time was spent loading those icons.

With Qt 5.7, the GTK+ icon cache will be used to speedup the
loading of icons.

Verdigris is a header-only library that can be
used with Qt. It uses macros to create a QMetaObject that is binary compatible with Qt's own
QMetaObject without requiring moc.
In other words, you can use Verdigris macros in your Qt or QML application instead of some of the Qt
macros and then you do not need to run moc.

We made some improvements to QDockWidget for Qt 5.6. You can now re-order your QDockWidget's tabs with the mouse.
There is also a new mode you can set on your QMainWindow so that you can drag and drop full groups of
tabbed QDockWidgets. Furthermore there is a new API which allows you to programatically resize the QDockWidgets.

Qt 5.5 was just released and with it comes a new Q_ENUM macro, a better alternative to the now deprecated Q_ENUMS (with S).

In this blog post, I will discuss this new Qt 5.5 feature; What it does, and how I implemented it.
If you are not interested by the implementation details, skip to the conclusion to see what you can do in Qt 5.5 with Q_ENUM.

A ShaderEffect is a QML item that takes a GLSL shader program allowing applications to render using the GPU directly. Using only property values as input as with the Canvas in our previous article, we will show how a ShaderEffect can be used to generate a different kind visual content, with even better performances. We will also see how we can use the fluidity it provides in user interface designs, again taking Google's Material Design as a concrete example.

Google's Material Design showcases a few nicely detailed animations that add life to the user interface. QML makes it straightforward to create the traditional moving, scaling and opacity change animations while taking advantage of the GPU, but how can we create an animation changing the shape of an element and not merely transforming it?

We'll make sure that we use the GPU to accelerate the rendering and use standard QtQuick animations to control the drawing evolution, as conveniently as with traditional transform animations.

Since you can animate any property in QML, not only the built-in ones, you can define the animation parameters declaratively as properties and then use those as input for your JavaScript Canvas drawing code, requesting a repaint each time an input changes.

QMetaType is Qt's way to have run-time dynamic information about your types. It enables
things such as QVariant wrapping of custom types, copy of queued connection arguments, and more.

If you ever wondered what does Q_DECLARE_META_TYPE
or qRegisterMetaType do and when to use (or not to use) them, read on.
This article will describe what you need to know about QMetaType: What is its purpose; How to use it;
And how it works.

If you are using Qt, you might have some qDebug or qWarning statements in your code.
But did you know that you can greatly improve the output of those with the QT_MESSAGE_PATTERN environment variable?
This blog post will give you some hints and examples of what you can do.

C++14 is the name of the version of the standard to be released this year.
While C++11 has brought many more feature that took time to be implemented by the compilers,
C++14 is a much lighter change that is already implemented by compilers such as clang or gcc.

This is the story how I have (not) solved a race condition that impacts QWaitCondition and is also present on every other condition variable implementations (pthread, boost, std::condition_variable).

bool QWaitCondition::wait(int timeout) is supposed to return true if the condition variable was met and false if it timed out. The race is that it may return false (for timeout) even if it was actually woken up.

The Qt toolkit has often been criticized for extending C++ and requiring a non-standard code generator (moc) to provide introspection.
Now, the C++ standardization committee is looking at how to extend C++ with introspection and reflection.
As the current maintainer of Qt's moc I thought I could write a bit about the need of Qt,
and even experiment a bit.

In this blog post, I will comment on the current proposal draft, and try to analyze what one would need to be able to get rid of moc.

We have been running our browsable code
repository code.woboq.org for quite a while now.
Adding more and more projects, at some point we noticed that we were getting low on disk space.
In this blog post, we explain how we saved huge amount of disk space holding our static HTML files.

For our first customer iOS application, I had to learn Objective C.
Coming from the Qt world
that was not too hard. To make life even easier for the readers of this blog, I am going
to describe some of the things I have learnt. This is more of a brain dump than a tutorial, but I still hope it is useful for you.
I'll first write about the language differences and then about the class libraries.

QtQuick and QML form a really nice language to develop user interfaces.
The QML Bindings are very productive and convenient. The declarative syntax is really a pleasure to work with.
Would it be possible to do the same in C++?
In this blog post, I will show a working implementation of property bindings in pure C++.

Disclaimer: This was done for the fun of it and is not made for production.

This is the sequel of my
previous article explaining the implementation details of the signals and slots.
In the Part 1, we have seen
the general principle and how it works with the old syntax.
In this blog post, we will see the implementation details behind the
new function pointer
based syntax in Qt5.

Qt is well known for its signals and slots mechanism. But how does it work?
In this blog post, we will explore the internals of QObject and QMetaObject
and discover how signals and slot work under the hood.

In this blog article, I show portions of Qt5 code,
sometimes edited for formatting and brevity.

As a developer, I write code, but I also read a lot of code. Often the code of other people.
It is easy to get lost among all the functions, objects or files. What calls what? What does this
function exactly do? Where is this variable modified?
It is important that as much information as possible can be presented or easily accessible.

Good IDEs are good at displaying that information and ease the navigation in the source code.
But often, I want to browse source code which I don't necessarily have on my hard drive.
While I look at code on the web, I am very disturbed by the poor browsing experience.
This is why I developed an online code browser.

SIMD: "Single instruction, multiple data"
is a class of instructions present in many CPUs today.
For example, on the Intel CPU they are known under the SSE acronym.
Those instructions enable more parallelism by operating simultaneously on multiple data.

In this blog post I will present a method for converting UTF-8 text to UTF-16 using SSE4 compiler intrinsics.
My goal is also to introduce you to the SIMD intrinsics, if you are not familiar with them yet.

QStringLiteral
is a new macro introduced in Qt 5 to create QString from string literals.
(String literals are strings inside "" included in the source code).
In this blog post, I explain its inner working and implementation.

While I was working on Qt at Nokia I spent a lot of time
reviewing patches from colleagues.

Peer reviewing is an important step, and there is a reason why we do it in Qt.
Code in libraries (such as Qt) requires much greater care than application code.
The main reason is that you need to maintain compatibility for your users.
You want to avoid regressions in your library, so code that works
continues to work, even if the user did some hack or trick.
For the user of the library, it has great value to be able to upgrade it without
too much effort.
A subtle behaviour difference in the library might introduce a bug in the application
that might be really hard to track in the millions of old lines of code of the application.

You may want to read this blog if you want to understand the internals of QMutex
or if you are interested in lock-free algorithms and want to discover one.
You do not need to read or understand this article if you just want to use QMutex
in your application.
I found implementing QMutex interesting and therefore I want to share the knowledge.

I am going to show and explain a simplified version of the real code.
If you want to see the real code, you can just browse the Qt source code.
This article will help you to understand the concepts.

This blog post is an introduction to lock-free programming.
I'm writing this because this is the pre-requisite to understand
my next post.
This was also the content of my presentation for
Qt Developer Days 2011.

Lock-free programming
is the design of algorithms and data structures that do not
acquire locks or mutexes.