Hi,
What is the best approach to work around the QtQuick1 limitations for this ?
ListElement: cannot use script for property value
remainingTimeElementRole: (function () { return (countDownTimerValue / 60 / 10).toFixed(0); }) ();
I began without a closure, and then I had that idea to try out, but apparently no go. 
Here is the ListModel code:
ListModel {
id: remainingTimeModel;
ListElement {
remainingTimeElementRole: (countDownTimerValue / 60 / 10).toFixed(0);
}
ListElement {
remainingTimeElementRole: countDownTimerValue / 60 % 10;
}
ListElement {
remainingTimeElementRole: ":";
}
ListElement {
remainingTimeElementRole: (countDownTimerValue % 60 / 10).toFixed(0);
}
ListElement {
remainingTimeElementRole: countTimerDownTimerValue % 60 % 10;
}
}
ListModel {
id: remainingTimeModel;
ListElement {
remainingTimeElementRole: (countDownTimerValue / 60 / 10).toFixed(0);
}
ListElement {
remainingTimeElementRole: countDownTimerValue / 60 % 10;
}
ListElement {
remainingTimeElementRole: ":";
}
ListElement {
remainingTimeElementRole: (countDownTimerValue % 60 / 10).toFixed(0);
}
ListElement {
remainingTimeElementRole: countTimerDownTimerValue % 60 % 10;
}
}
To copy to clipboard, switch view to plain text mode
Thank you in advance!
Added after 11 minutes:
Probably for loop in a Component.onCompleted block inside the ListModel, and call ListModel append() with the appropriate values is the simplest hack around. :/
Bookmarks