davidedmundson added a comment.
For any C++ project you're right that you'd use that or even a basic for loop instead of a model. But when writing declaratively means we shouldn't be doing programatic lopos. For a KDE project I wanted a QtQuickControls2 Tumbler to show year selection something like 1970 -> 2100 or whatever. You can do Tumbler {model: 130 delegate: Text{text:1970+model.value}} but then you have to do a whole fuss getting the value back, it's totally doable but not very clean. For a home project I had a repeater with a bunch of buttons 1->4 which again required the whole "text: index + 1" or a JS for loop creating items. INLINE COMMENTS > markg wrote in knumbermodel.cpp:121 > Won't this give compile warnings? It's double and int foo mixed. > Also, the +1 should probably be "+ d->step" right, the max should be 0. The +1 is for the first entry i.e min=5 max=5 = 1 starting point min=5 max=7 = 1 starting poing + 2 complete steps == 3 rows REPOSITORY R275 KItemModels REVISION DETAIL https://phabricator.kde.org/D13358 To: davidedmundson Cc: markg, kde-frameworks-devel, michaelh, ngraham, bruns