• Skip to content
  • Skip to link menu
KDE API Documentation - Template.qml Source File (GCompris-qt)
  • KDE Home
  • Contact Us
 

GCompris-qt

  • src
  • activities
  • template
Template.qml
1 /* GCompris - template.qml
2  *
3  * Copyright (C) 2015 YOUR NAME <xx@yy.org>
4  *
5  * Authors:
6  * <THE GTK VERSION AUTHOR> (GTK+ version)
7  * YOUR NAME <YOUR EMAIL> (Qt Quick port)
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, see <http://www.gnu.org/licenses/>.
21  */
22 import QtQuick 2.1
23 
24 import "../../core"
25 import "template.js" as Activity
26 
27 ActivityBase {
28  id: activity
29 
30  onStart: focus = true
31  onStop: {}
32 
33  pageComponent: Rectangle {
34  id: background
35  anchors.fill: parent
36  color: "#ABCDEF"
37  signal start
38  signal stop
39 
40  Component.onCompleted: {
41  activity.start.connect(start)
42  activity.stop.connect(stop)
43  }
44 
45  // Add here the QML items you need to access in javascript
46  QtObject {
47  id: items
48  property Item main: activity.main
49  property alias background: background
50  property alias bar: bar
51  property alias bonus: bonus
52  }
53 
54  onStart: { Activity.start(items) }
55  onStop: { Activity.stop() }
56 
57  GCText {
58  anchors.centerIn: parent
59  text: "template activity"
60  fontSize: largeSize
61  }
62 
63  DialogHelp {
64  id: dialogHelp
65  onClose: home()
66  }
67 
68  Bar {
69  id: bar
70  content: BarEnumContent { value: help | home | level }
71  onHelpClicked: {
72  displayDialog(dialogHelp)
73  }
74  onPreviousLevelClicked: Activity.previousLevel()
75  onNextLevelClicked: Activity.nextLevel()
76  onHomeClicked: activity.home()
77  }
78 
79  Bonus {
80  id: bonus
81  Component.onCompleted: win.connect(Activity.nextLevel)
82  }
83  }
84 
85 }
ActivityBase
The base QML component for activities in GCompris.
Definition: ActivityBase.qml:52
Bonus
A QML component providing user feedback upon winning/loosing.
Definition: Bonus.qml:39
BarEnumContent
QML container for defining all visible child elements of a Bar.
Definition: BarEnumContent.qml:31
ActivityBase::start
void start()
Emitted every time the activity has been started.
GCText
A QML component unifying text presentation in GCompris.
Definition: GCText.qml:47
QtQuick
Bar
A QML component for GCompris' navigation bar.
Definition: Bar.qml:43
DialogHelp
GCompris' full screen help dialog.
Definition: DialogHelp.qml:36
BarEnumContent::home
int home
Representation of the home button.
Definition: BarEnumContent.qml:69
main
GCompris' main QML file defining the top level window.
Definition: main.qml:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Tue Jun 2 2015 21:47:47 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

GCompris-qt

Skip menu "GCompris-qt"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List
  • Modules

Class Picker

Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal