[GCompris-devel] Needs help on javascript/qml binding

Emmanuel Charruau echarruau at gmail.com
Sat Oct 24 11:23:51 UTC 2015


Hi everybody,

I have started a new activity based on babymatch. The activity is a
multiple choices activity based on sentences and words.
I display a sentence and mutiple choices items for the kid to choose
between answers.

I have done a prototype in qml displaying a sentence in a flow.
This sentence is made of different types of words. Words that are plain
text (just there to show a normal sentence); words that will be show in
color as they will have to be analysed by the user, and finally mutiple
choices words.
That works.

This prototype can be found here:
https://github.com/allon49/GCompris-qt/blob/41d6cdae0f036dac0f4f1a0f7fa59b89612def00/src/activities/multiple_choices_sentences/TextItem.qml
.

Now I want to implement the same thing using javascript, but I am not able
to associate the items components I create to the flow element contained in
my element SentenceItem.qml

I can see how the babyshape author has done this in the main qml file
mutiple_choices_sentences.qml using "QtObject { id: items property alias".
But I don't see how to apply it to my element SentenceItem.qml as I don't
know how to create an equivalent to "items" which is set using onStart: {
Activity.start(items, url, levelCount, answerGlow, displayDropCircle) } in
multiple_choices_sentences.qml.

the code can be found here
https://github.com/allon49/GCompris-qt/tree/41d6cdae0f036dac0f4f1a0f7fa59b89612def00/src/activities/multiple_choices_sentences

Thanks a lot for you help if you can as I have no idea how to go over this
problem.


Regards,

Emmanuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/gcompris-devel/attachments/20151024/9915151f/attachment.html>


More information about the GCompris-devel mailing list