From 7eddc26d24defb3444e21adfbd43f8e568be576d Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 22 Jul 2017 04:30:45 +0200 Subject: ModelIndexRetriever to abuse Repeater less publicly Simliar to Retriever, but we'd have to alias all properties/roles automatically somehow. --- framework/qml/ModelIndexRetriever.qml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 framework/qml/ModelIndexRetriever.qml (limited to 'framework/qml') diff --git a/framework/qml/ModelIndexRetriever.qml b/framework/qml/ModelIndexRetriever.qml new file mode 100644 index 00000000..fa3fb64b --- /dev/null +++ b/framework/qml/ModelIndexRetriever.qml @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2017 Christian Mollekopf, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.4 + +Repeater { + id: root + property var currentData + Item { + id: delegate + property var currentData: model + onCurrentDataChanged: { + root.currentData = model + } + visible: false + } +} -- cgit v1.2.3