The Cascading UI Wireframe
Introduction How can we set up a project structure for a QML-heavy application that is easy to navigate for each team member, regardless of experience level? Something that can be intuitively understood by every contributor, including designers and product owners? Also, how should we decide what goes into a QML …
What makes Control components so magical?
Problem Statement If you come from traditional UI toolkits such as GTK [1] or Qt Widgets [2] then the ultra-flexible way in how QML lets you position items and deal with layouts will be confusing. First, there isn't just one way but several layout strategies to choose from: Direct positioning …
Implementing natural zoom for images
Problem statement Many QML applications will at some point have to show photos or images of some form. QML has an obviously named component for that, Image [1]. It's easy enough to use: Image { source: "url/or/path/to/image.png" // or a data URL fillMode: Image.PreserveAspectFit } We can …
Decorating QML Actions with extra behaviour
Problem statement Let's assume our application was designed to preferredly use QML Actions. Although our components are now nicely decoupled [1], it won't be too long until we face some limitations. Namely that there is no easy way to intercept a QML Action's trigger such that we could run additional …
Using QML Actions to decouple components
Problem statement Imagine a simple application with three pages and a toolbar to navigate between the pages. In QML, we can use a StackView [1] to display the pages, together with nice transition animations. Here's our Main.qml: ApplicationWindow { id: root title: "Using QML Actions to Decouple Components" width: 1280 …
Beginner's guide to property bindings
Introduction In QML, state propagates through properties. They can be linked to expressions, thus forming property bindings. In the simplest case, the linked expression is another property. Whenever its stored value changes, bound properties get notified so they can react to these changes. This mechanism is known as Active Updating …
Overcoming trivially constructable types
Problem statement We already learned [1] that as a consequence of how new types are defined, QML components have to be trivially constructable: Besides the hidden parent parameter, no other parameter can be injected directly into the constructor. Instead, we have to use properties to set up the object. Let's …