I'm working on qml support of calendar system,
for porting this mechanism to qml we have two option:
1)
Add a global object to jsengine?
Somthing like that :
var date = new Date;
var cal = new JalaliCalendar;
var out = date.toString(cal, "yyyy-MM-dd");
In this case JalaliCalendar is a new global object type (like date, string,
regex, array and etc).
2)
Or another option may be adding calendar() to global Qt function, the usage
example can be like that:
var date = new Date;
var out = date.toString(Qt.calendar('jalali'), "yyyy-MM-dd");
3)
var date = new Date;
var out = date.toString(Qt.JalaliCalendar, "yyyy-MM-dd");
In this method Qt.calendar like Qt.locale initialize with a string.
Now question is that: witch form is preferred? Will be case (1) break Qt
rules?
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development