https://bugs.kde.org/show_bug.cgi?id=487169

--- Comment #2 from Ryan <r...@interoctiv.com> ---
ExerciseView.qml is the code in question:
https://github.com/KDE/minuet/blob/ab3fcedec21096ed1166e6872b9160705538bb84/src/app/qml/ExerciseView.qml#L317

Based on the documentation documentation here
https://doc.qt.io/qt-6/qml-qtquick-mousearea.html, here
https://doc.qt.io/qt-6/qtqml-syntax-objectattributes.html, and here
https://doc.qt.io/qt-6/qtqml-syntax-signals.html#property-change-signal-handlers),
my best guesses as a non-developer are these:

(a) Line 317 is missing an object declaration needed to explicitly point to the
onExit handler or set a property.
(b) Line 317 should use the `exited()` signal instead of `onExited` handler.
(c)

>313 MouseArea {
>314     anchors.fill: parent
>315     onClicked: {
>316         if (exerciseView.state == "waitingForAnswer" && 
>!animation.running) {
>317             onExited()
>...
>322         }
>323     }

ExerciseView.qml also includes the onExited handler. I think this is
irrelevant, because hovering over and exiting the button area work as expected
(activate/deactivate shading and the piano animation).

>     onExited: {
>         answerRectangle.color = 
> internal.colors[answerRectangle.index%internal.colors.length]
>         if (currentExercise["playMode"] != "rhythm") {
>             if (parent.parent == answerGrid) {
>                 if (!animation.running)
>                     model.sequence.split(' ').forEach(function(note) {
>                         pianoView.noteUnmark(0, 
> core.exerciseController.chosenRootNote() + parseInt(note), 0)
>                     })
>                 sheetMusicView.model = 
> [core.exerciseController.chosenRootNote()]
>             }
>         }
>         else {
>             var rightAnswers = core.exerciseController.selectedExerciseOptions
>             if (parent.parent == yourAnswersParent && 
> internal.userAnswers[position].name != rightAnswers[position].name) {
>                 parent.border.color = "red"
>                 parent.color = internal.userAnswers[position].color
>                 rhythmImage.source = "exercise-images/" + 
> internal.userAnswers[position].name + ".png"
>             }
>         }
>     }
> }

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to