~chris.gagnon/+junk/qtpim-coverage

« back to all changes in this revision

Viewing changes to src/organizer/doc/snippets/qmlorganizerbasiclist/qmlorganizerbasiclist.qml

  • Committer: chris.gagnon
  • Date: 2013-12-10 23:09:37 UTC
  • Revision ID: chris.gagnon@canonical.com-20131210230937-2akf1ft1edcttk87
first post

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
 
4
** Contact: http://www.qt-project.org/legal
 
5
**
 
6
** This file is part of the documentation of the Qt PIM Module.
 
7
**
 
8
** $QT_BEGIN_LICENSE:FDL$
 
9
** Commercial License Usage
 
10
** Licensees holding valid commercial Qt licenses may use this file in
 
11
** accordance with the commercial license agreement provided with the
 
12
** Software or, alternatively, in accordance with the terms contained in
 
13
** a written agreement between you and Digia.  For licensing terms and
 
14
** conditions see http://qt.digia.com/licensing.  For further information
 
15
** use the contact form at http://qt.digia.com/contact-us.
 
16
**
 
17
** GNU Free Documentation License Usage
 
18
** Alternatively, this file may be used under the terms of the GNU Free
 
19
** Documentation License version 1.3 as published by the Free Software
 
20
** Foundation and appearing in the file included in the packaging of
 
21
** this file.  Please review the following information to ensure
 
22
** the GNU Free Documentation License version 1.3 requirements
 
23
** will be met: http://www.gnu.org/copyleft/fdl.html.
 
24
** $QT_END_LICENSE$
 
25
**
 
26
****************************************************************************/
 
27
 
 
28
//! [Basic list Complete Snippet]
 
29
import QtQuick 2.0
 
30
import QtOrganizer 5.0
 
31
 
 
32
Rectangle {
 
33
    id : organizerSample
 
34
    width: 200
 
35
    height: 400
 
36
 
 
37
    Rectangle {
 
38
        id:organizerEventView
 
39
 
 
40
        anchors.fill: parent
 
41
        color: "white"
 
42
 
 
43
//! [Organizer Model]
 
44
        OrganizerModel {
 
45
            id: organizer
 
46
 
 
47
            startPeriod: "1970-01-01"
 
48
            endPeriod:'2012-12-31'
 
49
            autoUpdate:true
 
50
 
 
51
            //! [Manager Choice]
 
52
//            manager:"qtorganizer:jsondb:id=qml"
 
53
            manager:"qtorganizer:memory:id=qml"
 
54
            //! [Manager Choice]
 
55
 
 
56
            Component.onCompleted : {
 
57
                if (managerName == "memory") {
 
58
                    organizer.importItems(Qt.resolvedUrl("content/organizer_ical_test.ics"));
 
59
                    console.log("Memory backend : import Items executed.");
 
60
                }
 
61
            }
 
62
        }
 
63
//! [Organizer Model]
 
64
 
 
65
//! [List View]
 
66
        ListView {
 
67
            id: calendar
 
68
            anchors.fill: parent
 
69
 
 
70
            clip: true
 
71
 
 
72
            delegate: Text { text: model.item.displayLabel }
 
73
            model: organizer
 
74
        }
 
75
//! [List View]
 
76
    }
 
77
}
 
78
//! [Basic list Complete Snippet]