Warning, /education/gcompris/src/activities/template/Template.qml is written in an unsupported language. File is not indexed.
0001 /* GCompris - template.qml 0002 * 0003 * SPDX-FileCopyrightText: YEAR NAME <EMAIL> 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 import QtQuick 2.12 0007 0008 import "../../core" 0009 import "template.js" as Activity 0010 0011 ActivityBase { 0012 id: activity 0013 0014 onStart: focus = true 0015 onStop: {} 0016 0017 pageComponent: Rectangle { 0018 id: background 0019 anchors.fill: parent 0020 color: "#ABCDEF" 0021 signal start 0022 signal stop 0023 0024 Component.onCompleted: { 0025 activity.start.connect(start) 0026 activity.stop.connect(stop) 0027 } 0028 0029 // Add here the QML items you need to access in javascript 0030 QtObject { 0031 id: items 0032 property Item main: activity.main 0033 property alias background: background 0034 property int currentLevel: activity.currentLevel 0035 property alias bonus: bonus 0036 } 0037 0038 onStart: { Activity.start(items) } 0039 onStop: { Activity.stop() } 0040 0041 GCText { 0042 anchors.centerIn: parent 0043 text: "template activity" 0044 fontSize: largeSize 0045 } 0046 0047 DialogHelp { 0048 id: dialogHelp 0049 onClose: home() 0050 } 0051 0052 Bar { 0053 id: bar 0054 level: items.currentLevel + 1 0055 content: BarEnumContent { value: help | home | level } 0056 onHelpClicked: { 0057 displayDialog(dialogHelp) 0058 } 0059 onPreviousLevelClicked: Activity.previousLevel() 0060 onNextLevelClicked: Activity.nextLevel() 0061 onHomeClicked: activity.home() 0062 } 0063 0064 Bonus { 0065 id: bonus 0066 Component.onCompleted: win.connect(Activity.nextLevel) 0067 } 0068 } 0069 0070 }