Jump to Navigation

Data Models in QML

Session Summary: 
The presentation name is “Data Models in QML”. QML introduces a Model-View-Delegate concept which is similar to but has differences from what is traditionally used in Qt. With QML there comes a whole set of data models each of which has its own capabilities and is designed to solve different kinds of tasks having the appropriate model declared in your QML application. We will discuss which one you should use for your particular use case. Special attention will be paid to custom data models that are implemented in Qt using C++ and then exported to the QML environment. We will also see how views with appropriate delegates are represented in QML and how, for example, list views are different from what we are used to seeing in Qt.
Session Abstract: 

Model-View-Controller has been a very useful design pattern that has found application in a large number of computer programs, helping to improve the architecture and code quality. A lot of application development frameworks provide the ability to reuse models and views, creating a more solid and flexible application structure.
Qt is one of the frameworks that provides a model-view-controller architecture with a large number of classes that include both an predefined set of widgets and appropriate models for them, as well as a number of abstract classes that allow developing fully customized models, views and delegates with a Qt Model-View-Controller compatible API. Users can choose between using a series of views that represent list, table and tree data structures out of the box and extend them if needed, or create from scratch a completely custom implementation that satisfies their needs.
But what about Qt Quick? Can we take advantage of the Model-View-Controller design pattern in QML applications, as well as reuse our currently implemented Qt Model-View-Controller custom models that have been implemented in C++/Qt ? The answer is yes, and in this talk you will learn how to do that.
This talk will highlight a completely new Model-View-Controller API that is introduced in QML and will show you how to operate with model, view, and controller in a declarative way rather than in an object-oriented way. We will cover all the model classes that come with QtQuick “out of the box” including four powerful models: ListModel, XmlListModel, VisualItemModel and VisualDataModel. We will review the differences and advantages of each of the models so you can choose one that best suits your needs. Special attention will be paid to custom models that can be implemented in C++/Qt and exported to the QML environment to provide users with the full capability of data sources they want to operate on. We will support the presentation with a lot of examples where you can actually see how the code works. The presentation will also cover the views and delegates that can be used in QML applications.