项目作者: in-hub

项目描述 :
QML Object Repeater
高级语言: C++
项目地址: git://github.com/in-hub/qml-object-repeater.git
创建时间: 2018-12-14T12:57:52Z
项目社区:https://github.com/in-hub/qml-object-repeater

开源协议:GNU General Public License v3.0

下载


QML Object Repeater

The QmlObjectRepeater class implements a repeater for QObject-based
objects in QML. Unlike QQuickRepeater which only works for QtQuick items
the QmlObjectRepeater also works for non-graphical QML applications
without requiring the QtQuick module at all.

The implementation is based on QQuickRepeater and is nearly identical.
It only eliminates the QtQuick specifics and adds missing API parts
originally inherited from QQuickItem.

Copyright (c) 2018-2020 in.hub GmbH

Build and installation

  • Configure and build project via “qmake” and “make”
  • Install library and headers via “make install”

Usage

  • Add qml_object_repeater to the CONFIG variable in your Qt project
  • Include “QmlObjectRepeater.h” in your source file(s)
  • Register the QmlObjectRepeater or derived subclasses in the QML system
    via qmlRegisterType():

    qmlRegisterType<QmlObjectRepeater>("MyApp", 1, 0, "ObjectRepeater")

  • Use the repeater in your QML application

    1. ObjectRepeater {
    2. model: [ "Some", "model", "data" ]
    3. MyObject {
    4. name: "My object " + index
    5. data: modelData
    6. }
    7. }
  • See https://doc.qt.io/qt-5/qml-qtquick-repeater.html for more details
    on repeaters in general