You can just programmaticaly make a model.
Here is real code to make a list of 1 to 31 days for a date picker:
ListModel {
id: dayModel}//--- in Component.onCompleted: {
for (var i=1; i<32; i++)
dayModel.append({value: i, name: ''+i});
//--- }
Sent: Wednesday, November 04, 2015 at 9:53 AM
From: "Edward Sutton" <edward.sut...@subsite.com>
To: "Qt Interest" <interest@qt-project.org>
Subject: [Interest] Can QML model specify a range including negative numbers? For example -180 to +180 ?
From: "Edward Sutton" <edward.sut...@subsite.com>
To: "Qt Interest" <interest@qt-project.org>
Subject: [Interest] Can QML model specify a range including negative numbers? For example -180 to +180 ?
Is there a way to declare a QML model range from -180 to +180?
A method that does not require typing 361 numbers model: [-180, -179, … 0, … 179, 180 ] ?
I added a Tumbler to Combining Qt Widgets and QML with QWidget::createWindowContainer() to experiment with making QML readable and writable from C++.
Tumbler {
// latitude degrees -180 to +180
TumblerColumn {
model: 181 // <- Is there a way to declare model range -180 to +180 ?
}
// latitude minutes 0 - 59
TumblerColumn {
model: 60
}
// latitude seconds 0 - 59
TumblerColumn {
model: 60
}
}
Thanks in advance,
-Ed
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest