Better_Software_Header_Mobile Better_Software_Header_Web

Find what you need - explore useful information and developer resources

Areas of Interest

Searching…

330 results

In this video, we discuss the basics of model/view programming with Qt/QML. How do we expose a set of data (a list, a table, etc.) from the business logic to C++? How much flexibility do we have before the data actually reaches QML?

In this module we'll use the knowledge that we gained in module 7, QObject, signals, slots, properties, variants, in order to make C++ and QML talk to each other. In this first video, we are going to show how we can export objects of value classes (numbers, strings, etc.) from C++ to QML.

This video shows how to export QObject subclasses to QML. While similar to the previous video, QObjects aren't value classes and add features like properties, signals, and slots via the meta-object system. We get all these features when exporting QObjects to QML!

When QObjects in C++ are exposed to QML, who manages their lifetime? Can QML's garbage collector reclaim them if they're still needed in C++? What happens if C++ doesn't delete them, expecting QML to handle it? This video explores object ownership between C++ and QML.

This video discusses how to create GUI elements in C++, and make them available to QML. It's just as simple as creating non-GUI elements, with a very small twist.

Previous videos showed exporting individual C++ objects to QML. This video covers something related but different: exposing C++ classes to QML so QML can create instances. We'll start with non-GUI classes; the next video will cover GUI classes.

QVariant is a cornerstone Qt class used in the property system, model/view, and C++/QML data exchange. It's a type-erased container similar to std::any, storing objects of almost any type while remembering the stored type. This video demonstrates how QVariant works in practice.

"unresolved external symbol 'public: virtual struct QMetaObject ...'" - a mysterious linker error that sometimes occurs when working with QObjects and signals/slots. This video explains what causes it, how to solve it with just one click, and what happens behind the scenes where the build system meets signals and slots.

QObject implements a huge number of features: properties, events, signals and slots, automatic memory management and much more. In this module we are going to explore how they work and how they map to all the QML knowledge that we have built so far.

"When the user clicks this button, run this code" is one of programming's oldest problems. Qt's solution is the signals and slots mechanism: buttons emit signals when clicked, slots contain the code to run, and connections link them together. This video explains creating such connections in C++.

Did you know that you can connect a QObject signal to a lambda function, or to any free function or function object, for what it's worth? It's extremely convenient, but it comes with its own set of "gotchas" that we must understand. In this video we'll explain the syntax and reason behind the good use cases of connecting to a lambda function instead of connecting to a "regular" slot.

In the previous videos of this module we have learned how signals and slots work. We have also learned how to connect an existing signal to an existing slot (in all its variations). In this episode, we will build up on that knowledge and discuss how to declare and implement custom signals and slots – and why we would want to do that!