Commit 6f87321d authored by emmanuel charruau's avatar emmanuel charruau

modified tutorials to work with qt 5.12.5

parent 73fd0c75
......@@ -26,7 +26,7 @@
// TODO: remove settings in bar menu
import QtQuick 2.13
import QtQuick 2.6
import GCompris 1.0
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.5
......
......@@ -18,7 +18,8 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.13
import QtQuick 2.6
import GCompris 1.0
import "../../../core"
......@@ -71,18 +72,21 @@ Item {
numberClassDragElements.itemAt(numberClassDragButtonIndex).animationIsRunning = animationIsRunning
}
onFinished: {
numberClassDragElements.itemAt(numberClassDragButtonIndex).Drag.drop()
numberClassDragElements.itemAt(numberClassDragButtonIndex).z = 1000
if (animationSequenceIndex === 0) {
numberClassDragElements.itemAt(numberClassDragButtonIndex).x = numberClassDragButtonOrigX
numberClassDragElements.itemAt(numberClassDragButtonIndex).y = numberClassDragButtonOrigY
animationSequenceIndex++
numberClassDragButtonIndex = 1
numberClassParallelAnimation.running = true
} else if (animationSequenceIndex === 1) {
numberClassDragElements.itemAt(numberClassDragButtonIndex).x = numberClassDragButtonOrigX
numberClassDragElements.itemAt(numberClassDragButtonIndex).y = numberClassDragButtonOrigY
onRunningChanged: {
if (!running) {
numberClassDragElements.itemAt(numberClassDragButtonIndex).Drag.drop()
numberClassDragElements.itemAt(numberClassDragButtonIndex).z = 1000
if (animationSequenceIndex === 0) {
numberClassDragElements.itemAt(numberClassDragButtonIndex).x = numberClassDragButtonOrigX
numberClassDragElements.itemAt(numberClassDragButtonIndex).y = numberClassDragButtonOrigY
animationSequenceIndex++
numberClassDragButtonIndex = 1
numberClassParallelAnimation.running = true
} else if (animationSequenceIndex === 1) {
numberClassDragElements.itemAt(numberClassDragButtonIndex).x = numberClassDragButtonOrigX
numberClassDragElements.itemAt(numberClassDragButtonIndex).y = numberClassDragButtonOrigY
}
}
}
}
......
......@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.13
import QtQuick 2.6
import GCompris 1.0
import "../../../core"
......@@ -78,53 +78,56 @@ Item {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).animationIsRunning = animationIsRunning
}
onFinished: {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).Drag.drop()
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).z = 1000
if (animationSequenceIndex === 0) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex = 1
numberClassIndex = 0
numberColumnWeightIndex = 1
numberColumnWeightDragButtonIndex = 1
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 1) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex = 2
numberClassIndex = 0
numberColumnWeightIndex = 0
numberColumnWeightDragButtonIndex = 2
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 2) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex = 3
numberClassIndex = 1
numberColumnWeightIndex = 2
numberColumnWeightDragButtonIndex = 0
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 3) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex = 4
numberClassIndex = 1
numberColumnWeightIndex = 1
numberColumnWeightDragButtonIndex = 1
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 4) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex = 5
numberClassIndex = 1
numberColumnWeightIndex = 0
numberColumnWeightDragButtonIndex = 2
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 5) {
onRunningChanged: {
if (!running) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).Drag.drop()
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).z = 1000
if (animationSequenceIndex === 0) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex = 1
numberClassIndex = 0
numberColumnWeightIndex = 1
numberColumnWeightDragButtonIndex = 1
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 1) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex = 2
numberClassIndex = 0
numberColumnWeightIndex = 0
numberColumnWeightDragButtonIndex = 2
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 2) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex = 3
numberClassIndex = 1
numberColumnWeightIndex = 2
numberColumnWeightDragButtonIndex = 0
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 3) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex = 4
numberClassIndex = 1
numberColumnWeightIndex = 1
numberColumnWeightDragButtonIndex = 1
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 4) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex = 5
numberClassIndex = 1
numberColumnWeightIndex = 0
numberColumnWeightDragButtonIndex = 2
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 5) {
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(numberColumnWeightDragButtonIndex).y = weightColumnDragButtonOrigY
}
}
}
}
......
......@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.13
import QtQuick 2.6
import GCompris 1.0
import "../../../core"
......@@ -92,66 +92,68 @@ Item {
numberWeightDragElements.itemAt(dragButtonIndex).animationIsRunning = animationIsRunning
}
onFinished: {
numberWeightDragElements.itemAt(dragButtonIndex).Drag.drop()
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX //?
numberWeightDragElements.itemAt(dragButtonIndex).z = 1000
if (animationSequenceIndex === 0) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = unit_CLASS_INDEX
numberColumnWeightIndex = 2
dragButtonIndex = unit_WEIGHT_BUTTON_INDEX
weightRowIndex = 1
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 1) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = unit_CLASS_INDEX
numberColumnWeightIndex = unit_COLUMN_INDEX
dragButtonIndex = unit_WEIGHT_BUTTON_INDEX
weightRowIndex = 2
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 2) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = unit_CLASS_INDEX
numberColumnWeightIndex = unit_COLUMN_INDEX
dragButtonIndex = unit_WEIGHT_BUTTON_INDEX
weightRowIndex = 3
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 3) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = unit_CLASS_INDEX
numberColumnWeightIndex = hundred_COLUMN_INDEX
dragButtonIndex = hundred_WEIGHT_BUTTON_INDEX
weightRowIndex = 0
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 4) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = unit_CLASS_INDEX
numberColumnWeightIndex = hundred_COLUMN_INDEX
dragButtonIndex = hundred_WEIGHT_BUTTON_INDEX
weightRowIndex = 1
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 5) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = thousand_CLASS_INDEX
numberColumnWeightIndex = unit_COLUMN_INDEX
dragButtonIndex = thousand_WEIGHT_BUTTON_INDEX
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 6) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
onRunningChanged: {
if (!running) {
numberWeightDragElements.itemAt(dragButtonIndex).Drag.drop()
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX //?
numberWeightDragElements.itemAt(dragButtonIndex).z = 1000
if (animationSequenceIndex === 0) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = unit_CLASS_INDEX
numberColumnWeightIndex = 2
dragButtonIndex = unit_WEIGHT_BUTTON_INDEX
weightRowIndex = 1
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 1) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = unit_CLASS_INDEX
numberColumnWeightIndex = unit_COLUMN_INDEX
dragButtonIndex = unit_WEIGHT_BUTTON_INDEX
weightRowIndex = 2
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 2) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = unit_CLASS_INDEX
numberColumnWeightIndex = unit_COLUMN_INDEX
dragButtonIndex = unit_WEIGHT_BUTTON_INDEX
weightRowIndex = 3
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 3) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = unit_CLASS_INDEX
numberColumnWeightIndex = hundred_COLUMN_INDEX
dragButtonIndex = hundred_WEIGHT_BUTTON_INDEX
weightRowIndex = 0
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 4) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = unit_CLASS_INDEX
numberColumnWeightIndex = hundred_COLUMN_INDEX
dragButtonIndex = hundred_WEIGHT_BUTTON_INDEX
weightRowIndex = 1
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 5) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
animationSequenceIndex++
numberClassIndex = thousand_CLASS_INDEX
numberColumnWeightIndex = unit_COLUMN_INDEX
dragButtonIndex = thousand_WEIGHT_BUTTON_INDEX
numberWeightsParallelAnimation.running = true
} else if (animationSequenceIndex === 6) {
numberWeightDragElements.itemAt(dragButtonIndex).x = weightColumnDragButtonOrigX
numberWeightDragElements.itemAt(dragButtonIndex).y = weightColumnDragButtonOrigY
}
}
}
}
......
......@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.13
import QtQuick 2.6
import GCompris 1.0
import "../../../core"
......@@ -45,10 +45,12 @@ Item {
to: 0.1
duration: animation_DURATION
onFinished: {
console.log("test")
okButton.opacity = 1
Activity.checkAnswer()
onRunningChanged: {
if (!running) {
console.log("test")
okButton.opacity = 1
Activity.checkAnswer()
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment