From 7fa5ef9e1ce87d9602c12d26442427c8604472ef Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 22 Jun 2018 16:54:27 +0200 Subject: Add TableModel This is a QML type that can be used as a model for the new TableView. The model data is set by assigning a JavaScript array to the rows property (or by calling appendRow()). After data has been assigned for the first time, the available columns and roles are fixed for the lifetime of the model, as opposed to ListModel where the dynamicRoles property could be used. This is done intentionally to simplify the code. The API is designed to be familiar to users of ListModel: - To add new rows, use appendRow() and insertRow(). - To modify existing rows, use setRow(), moveRow(), removeRow(), and clear(). [ChangeLog][Qt Labs QML Models] Added the TableModel QML type, a JavaScript-based model for the new TableView. Fixes: QTBUG-70334 Change-Id: I55387a08b122227c5624f78af3d450b7695d974a Reviewed-by: Shawn Rutledge --- src/qml/types/types.pri | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/qml/types/types.pri') diff --git a/src/qml/types/types.pri b/src/qml/types/types.pri index e74c89b1f1..1765beb09e 100644 --- a/src/qml/types/types.pri +++ b/src/qml/types/types.pri @@ -6,7 +6,8 @@ SOURCES += \ $$PWD/qqmlobjectmodel.cpp \ $$PWD/qquickpackage.cpp \ $$PWD/qqmlinstantiator.cpp \ - $$PWD/qqmltableinstancemodel.cpp + $$PWD/qqmltableinstancemodel.cpp \ + $$PWD/qqmltablemodel.cpp HEADERS += \ $$PWD/qqmlbind_p.h \ @@ -17,7 +18,8 @@ HEADERS += \ $$PWD/qquickpackage_p.h \ $$PWD/qqmlinstantiator_p.h \ $$PWD/qqmlinstantiator_p_p.h \ - $$PWD/qqmltableinstancemodel_p.h + $$PWD/qqmltableinstancemodel_p.h \ + $$PWD/qqmltablemodel_p.h qtConfig(qml-worker-script) { SOURCES += \ -- cgit v1.2.3