Jesper K. Pedersen
278 results
In this third video of the series on developing document templates for Qt Creator, we will see how we can ask the user for additional input in the "new file" dialog, and use that in the templates.
Learn how to create custom document templates in Qt Creator through these four videos. This episode shows how to add a new .ui file to the generated file set, providing deeper insight into Qt Creator's macro system.
Learn how to create custom document templates in Qt Creator through these four videos. This first episode creates a simple class template based on the "C++ class" template, explains macro usage, and shows how macros expand into class names from the "new file" dialog.
I use many custom classes like Money, PercentageValue, and TimeValue with model/view. For years I've written `return QVariant::fromValue(cost);` in my QAbstractItemModel data methods. This short video shows a simple trick to avoid this.
In this video, we'll see how to examine a stack of proxy models using GammaRay, the Qt swiss-army knife. There are a couple of tips and tricks for you, to let you know how GammaRay works under the hood.
In this video, we talk about QSortFilterProxyModel, a proxy model class that sorts and filters a given source model. QSortFilterProxyModel is a concrete class and can either be used as-is, or subclassed in order to fine tune some of its behaviors.
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?
Proxy models allow sorting, filtering, modifying, transforming, and augmenting existing models without changing the original model. Instead of building complicated model classes with many options, you can simplify implementation and separate concerns using proxy models.
This video gives you my top seven shortcuts in Qt Creator that help me save hours (OK, maybe just minutes) every single day, but, much more importantly, ensures I stay focused on whatever problem I'm solving right now.
This video shows how you can use your own custom types to communicate between a model and a delegate editing these custom types. My example is a Money class which contains a currency and an amount. The delegate will see Money instances, rather than parse them from their string representation.
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.
Any non-trivial Qt application uses the model/view/controller framework, a design pattern separating data management from UI. This video focuses on the "model" aspect that interacts directly with data. Models are central to Qt across all UI stacks (Widgets, Quick, remote objects). While custom views are rare, developing custom models is very typical.
It can visualize the stack of models for you, but there is one thing you better remember in your code --watch this video to find out what it is! :)
Sometimes views or delegates need to ask questions of the source model at the bottom of a proxy model stack. While the previous video showed using custom roles for cell-specific data, this video demonstrates a better approach for non-cell-related data: traversing proxy models yourself to reach the actual source model.
Got a stack of proxy models where there is a subtle bug somewhere in there? No worries --GammaRay to the rescue! It can visualize the stack of models for you, but there is one thing you better remember in your code --watch this video to find out what it is!
Remember discussing QML properties 25 videos ago? Qt allows you to define properties in C++ for QObject subclasses by describing their type, name, and read/write methods. This final module video covers the Qt Property System, its usage, and how it fits the bigger picture. Bonus: how QVariant relates to the property system.


