From 6536076b1f1368d3c21b286a065915663d8a1946 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Fri, 11 Jan 2019 15:33:58 +0100 Subject: Add itemAtIndex to quick views This patch adds itemAtIndex method to ItemView-derived views and to PathView. [ChangeLog][QtQuick][QQuickItemView] Added itemAtIndex() to GridView, ListView and PathView to fetch a visible delegate by index. Change-Id: Id8475d06c1481036984fe5109bb52cf2729b1c21 Fixes: QTBUG-72961 Reviewed-by: Shawn Rutledge --- .../quick/qquicklistview/data/listview-itematindex.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/auto/quick/qquicklistview/data/listview-itematindex.qml (limited to 'tests/auto/quick/qquicklistview/data') diff --git a/tests/auto/quick/qquicklistview/data/listview-itematindex.qml b/tests/auto/quick/qquicklistview/data/listview-itematindex.qml new file mode 100644 index 0000000000..fba8b11933 --- /dev/null +++ b/tests/auto/quick/qquicklistview/data/listview-itematindex.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 + +ListView { + width: 400 + height: 400 + focus: true + model: 3 + + delegate: Text { + width: parent.width + height: 10 + property int idx: index + text: index + } +} -- cgit v1.2.3