diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-03-07 10:21:53 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-04-08 07:42:08 +0000 |
commit | 7a303424f2095c53889f8102f115ec38013ef8d9 (patch) | |
tree | 883debcf88b5a9ce3da8acef37b86fc865f79294 /tests/auto/qml/qqmltablemodel/data/TestModel.qml | |
parent | 74313fd30a79e6f26734127157870c4491331501 (diff) |
Add TableModelColumn
This allows us to support simple object rows by default,
which we expect to be the most common use case for TableModel.
Complex rows are supported, but with a limited subset of functionality.
Things that could be improved:
- Would be nice if we could get arbitrary/dynamic properties
like ListModel has, without the complex code that comes
with it. That way we could get rid of all of the role properties
and users could have their own custom roles. The limitation
of only having built-in roles becomes too restrictive very
quickly.
Change-Id: Icbdb6b39665851c55c69c0b79e0aa523c5d46dfe
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmltablemodel/data/TestModel.qml')
-rw-r--r-- | tests/auto/qml/qqmltablemodel/data/TestModel.qml | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/auto/qml/qqmltablemodel/data/TestModel.qml b/tests/auto/qml/qqmltablemodel/data/TestModel.qml index 7aeb5d03f4..00e1fa65a7 100644 --- a/tests/auto/qml/qqmltablemodel/data/TestModel.qml +++ b/tests/auto/qml/qqmltablemodel/data/TestModel.qml @@ -33,15 +33,18 @@ import "TestUtils.js" as TestUtils TableModel { id: testModel objectName: "testModel" - roleDataProvider: TestUtils.testModelRoleDataProvider + + TableModelColumn { display: "name" } + TableModelColumn { display: "age" } + rows: [ - [ - { name: "John" }, - { age: 22 } - ], - [ - { name: "Oliver" }, - { age: 33 } - ] + { + name: "John", + age: 22 + }, + { + name: "Oliver", + age: 33 + } ] } |