diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-02-13 18:19:08 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-02-28 08:11:19 +0000 |
commit | 368a1d918a49d01a380131205da2f205fb267a26 (patch) | |
tree | a2e7784ba42736bb36d33e54f07cc2ac476c0e7a /src/qml/doc | |
parent | b4ee855eb10cf9bfa44ce8e5de8f9ee6c5917764 (diff) |
TableModel: support built-in QML model roles
For the display role, we'll return the first role in that column
if it wasn't explicitly specified. For every other role, we can just
return an invalid QVariant. As usual, roleDataProvider can be used
for any data that is missing.
Before this patch, the extra roles were missing from roleNames,
so they couldn't be used in delegates.
Change-Id: I53ac5b75526bcddec44baf834f6a093115a70993
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/qml/doc')
-rw-r--r-- | src/qml/doc/snippets/qml/tablemodel/fruit-example-simpledelegate.qml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/doc/snippets/qml/tablemodel/fruit-example-simpledelegate.qml b/src/qml/doc/snippets/qml/tablemodel/fruit-example-simpledelegate.qml index ae1f8d0b71..5f00eb484b 100644 --- a/src/qml/doc/snippets/qml/tablemodel/fruit-example-simpledelegate.qml +++ b/src/qml/doc/snippets/qml/tablemodel/fruit-example-simpledelegate.qml @@ -100,6 +100,7 @@ Window { padding: 12 selectByMouse: true + // TODO: the property used here is undefined onAccepted: model.display = text Rectangle { |