On Wed, Sep 14, 2011 at 5:41 PM, John Layt <[email protected]> wrote: > Using a QLocalDate convenience class holding a QDate: > > QLocalDate myDate; > myDate.setDate(QDate::gregorianDate(2000, 1, 1)); > int localYear = myDate.year(); > QString localString = myDate.toString(); > QDateTimeEdit myEdit(myDate.date()); > myDate.setCalendar(QLocale::HebrewCalendar); > int hebrewYear = myDate.year(); > > Using new methods directly on QDate: > > QDate myDate = QDate::gregorianDate(2000,1,1); > int localYear = myDate.localYear(); > QString localString = QLocale::system().toString(myDate); > QDateTimeEdit myEdit(myDate); > int hebrewYear = myDate.localYear(QLocale::HebrewCalendar);
I like the above codes more than the others, but I'm afraid that putting everything on QDate would lead to a really big API for this class, and because of so the QLocalDate approach would be cleaner.. I just don't like the QDateCalculator one, not sure why (usually I like the "explicit" approach, but this time it doesn't look so nice hehe). Cheers! -- ------------------------------------------------------- Artur Duque de Souza openBossa INdT - Instituto Nokia de Tecnologia ------------------------------------------------------- Blog: http://blog.morpheuz.cc PGP: 0xDBEEAAC3 @ wwwkeys.pgp.net ------------------------------------------------------- _______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
