1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
import QtQuick 2.0
import QtOrganizer 5.0
OrganizerModel {
id: eventModel
manager:"eds"
property var listeners:[];
property bool isLoading: false
function addModelChangeListener(listener){
listeners.push(listener);
}
function removeModelChangeListener(listener) {
var i = listeners.indexOf(listener);
if(i != -1) {
listeners.splice(i, 1);
}
}
function getItems(startDate, endDate){
return itemsByTimePeriod(startDate,endDate);
}
onModelChanged: {
isLoading = false
if(listeners === undefined){
return;
}
for(var i=0; i < listeners.length ;++i){
(listeners[i])();
}
}
onStartPeriodChanged: {
isLoading = true
}
}
|