Underscore brings stream-based iterations with a simple map-reduce style framework.
For example, to get all of the texts in a QComboBox:
var texts = _.range(combo.count).map(function (i) { return combo.itemText(i); }); // texts is an array of StringsCode to insert into a sorted combobox based on the texts (in non-QtScript, this is done via a QSortProxyModel which is unavailable in QtScript):
var insertCBItem = function (cb, text) { var texts = _.range(cb.count).map(function (i) { return cb.itemText(i); }); var insertIdx = _.sortedIndex(texts, text, String.localeAwareCompare); cb.insertItem(insertIdx, text, data); };The only reservation is that the utility functions that use setTimeout() are unlikely to work due to QtScript not implementing them.