summaryrefslogtreecommitdiff
path: root/src/quick/doc/snippets
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2021-06-10 08:36:24 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2021-06-10 13:30:21 +0200
commitc60dc57dda052f800ac5ea16c208c2c70b366358 (patch)
tree98bed0f3bbcce697464a3b193d96d3348c9e5666 /src/quick/doc/snippets
parente20650e0702259b4be79be85a3d27e45db42efc1 (diff)
downloadqtdeclarative-c60dc57dda052f800ac5ea16c208c2c70b366358.tar.gz
doc: update the selection model snippet
Fix up some minor issues in the documentation of selection support in TableView. Pick-to: 6.2 Change-Id: Ica2c0014f4e7f960332c283c1ff83a6b0bdd7df2 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Diffstat (limited to 'src/quick/doc/snippets')
-rw-r--r--src/quick/doc/snippets/qml/tableview/selectionmodel.qml11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/quick/doc/snippets/qml/tableview/selectionmodel.qml b/src/quick/doc/snippets/qml/tableview/selectionmodel.qml
index b971e89979..8d7cb05f1c 100644
--- a/src/quick/doc/snippets/qml/tableview/selectionmodel.qml
+++ b/src/quick/doc/snippets/qml/tableview/selectionmodel.qml
@@ -62,17 +62,10 @@ Window {
visible: true
visibility: Window.AutomaticVisibility
- Button {
- id: button
- text: "Toggle"
- onClicked: tableView.selectionModel.select(tableView.model.index(0, 0), ItemSelectionModel.Toggle)
- }
-
//![0]
TableView {
id: tableView
anchors.fill: parent
- anchors.topMargin: button.height
clip: true
model: TableModel {
@@ -87,8 +80,10 @@ Window {
delegate: Rectangle {
implicitWidth: 100
implicitHeight: 30
+ color: selected ? "blue" : "lightgray"
+
required property bool selected
- color: selected ? "green" : "lightgray"
+
Text { text: display }
}
}