There is a Math.random() function under javascript. One solution would be to use it with ListModel.move() to shuffle the ListModel after it has been created.
Another solution would be to have the data come from a C++ model, like a QList<QObject*>, and to the shuffling from C++. On Thu, Jul 22, 2010 at 4:24 PM, Shady Zayat <[email protected]> wrote: > I am using a Row and a Repeater to display data from a ListModel. Is there > a way to randomize the order of the displayed elements? I'm implementing > radio group behavior for multiple-choice questions for a learning > application ( "Choice" is a kind of a radio button ). I need the choices to > be displayed in a random order. > > Row { > > id: choicesRow > > spacing: 10 > > Repeater { > > model: elementChoices > > Choice { > > id: choice > > text: choiceText > > onButtonChecked: root.uncheckOthers(choice) > > } > > } > > } > > -- > Shady Zayat > > > _______________________________________________ > Qt-qml mailing list > [email protected] > http://lists.trolltech.com/mailman/listinfo/qt-qml > >
_______________________________________________ Qt-qml mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-qml
