diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-22 04:30:45 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-22 04:30:45 +0200 |
commit | 7eddc26d24defb3444e21adfbd43f8e568be576d (patch) | |
tree | 3304b432ba49ef52df8f9de993a7ea4694dc0fff /framework/qml/ModelIndexRetriever.qml | |
parent | 26e02b898d3f4e63c942d2742cb920aec9e6489c (diff) | |
download | kube-7eddc26d24defb3444e21adfbd43f8e568be576d.tar.gz kube-7eddc26d24defb3444e21adfbd43f8e568be576d.zip |
ModelIndexRetriever to abuse Repeater less publicly
Simliar to Retriever, but we'd have to alias all properties/roles
automatically somehow.
Diffstat (limited to 'framework/qml/ModelIndexRetriever.qml')
-rw-r--r-- | framework/qml/ModelIndexRetriever.qml | 32 |
1 files changed, 32 insertions, 0 deletions
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 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | import QtQuick 2.4 | ||
20 | |||
21 | Repeater { | ||
22 | id: root | ||
23 | property var currentData | ||
24 | Item { | ||
25 | id: delegate | ||
26 | property var currentData: model | ||
27 | onCurrentDataChanged: { | ||
28 | root.currentData = model | ||
29 | } | ||
30 | visible: false | ||
31 | } | ||
32 | } | ||