Skip to content

qt-learning/ModelViewCPP

Repository files navigation

C++ Models With QML Views

Welcome to the repository for the course "C++ Models With QML Views" on Qt Academy.

Get the full learning experience by enrolling in the course on Qt Academy

What You'll Learn

  • Building a QAbstractListModel in C++ to display data in a QML ListView.

  • Building a QAbstractTableModel in C++ to display data in a QML TableView.

  • Building a QAbstractItemModel in C++ to display hierarchical data in a QML TreeView.

  • Using QSortFilterProxyModel and QIdentityProxyModel in C++ to perform sorting, filtering, and data modification in a QML ListView.

  • Using QTransposeProxyModel in C++ to transpose a QML TableView.

Getting Started

In this course, you will learn how to create custom C++ models and integrate them with QML views. The repository contains reference projects for each video section:

Folder Description
CppModelsViews_Section2 QAbstractListModel with a QML ListView
CppModelsViews_Section3 QAbstractTableModel with a QML TableView
CppModelsViews_Section4 QAbstractItemModel with a QML TreeView
CppModelsViews_Section5 QSortFilterProxyModel and QIdentityProxyModel
CppModelsViews_Section6 QTransposeProxyModel with a QML TableView

Note: The projects are not required to complete the course, but are provided as a reference to help you understand the concepts discussed.

All examples in this repository were built and tested with Qt 6.8.0 using a MinGW 64-bit kit.

Instructions

To get started with this project, you will need to have Qt (6.8 or later) and an IDE (e.g., Qt Creator) installed on your computer. You can download Qt and Qt Creator from the Qt.io website.

Once you have Qt and an IDE installed, head over to Qt Academy and follow along with the course videos.

To run any project in Qt Creator:

  1. Navigate to the project folder
  2. Open the CMakeLists.txt file
  3. Build and run the project

Resources

If you need additional help, the following resources may be helpful:

Licensing Information

Copyright (C) 2026 Qt Group.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

This course teaches essential techniques for building custom C++ models and integrating them with Qt Quick views.

Terms and Conditions

If you, your employer, or the legal entity you act on behalf of hold commercial license(s) with a Qt Group entity, this software package constitutes Pre-Release Code under the Qt License/Frame Agreement governing those licenses, and that agreement's terms and conditions govern your access and use of this software package.

This software package may provide links or access to third party libraries or code (collectively "Third-Party Software") to implement various functions. Use or distribution of Third-Party Software is discretionary and in all respects subject to applicable license terms of applicable third-party right holders.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors