From 368a1d918a49d01a380131205da2f205fb267a26 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 13 Feb 2019 18:19:08 +0100 Subject: 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 --- src/qml/doc/snippets/qml/tablemodel/fruit-example-simpledelegate.qml | 1 + 1 file changed, 1 insertion(+) (limited to 'src/qml/doc/snippets') 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 { -- cgit v1.2.3