Hi all,
as you can see in the two images, Date is formatted with differences on Mac and on Win
here is the code:

Qt Code:
  1. #include "CustomModel.h"
  2. #include <QtGui>
  3.  
  4.  
  5. CustomModel::CustomModel(QObject *parent): QSqlQueryModel(parent) {
  6. }
  7.  
  8. QVariant CustomModel::data(const QModelIndex &index, int role) const {
  9. QVariant value = QSqlQueryModel::data(index, role);
  10. if (value.isValid() && role == Qt::DisplayRole) {
  11. if (index.column() == 1)
  12. return value.toString();
  13. else if (index.column() == 2)
  14. return value.toString();
  15. else if (index.column() == 3)
  16. return QDateTime::fromString(value.toString(),"dd.MM.yyyy hh:mm:ss");
  17.  
  18.  
  19. }
  20. return value;
  21. }
To copy to clipboard, switch view to plain text mode 

Mac:
http://img253.imageshack.us/my.php?i...agine18uz4.png


Win:
http://img187.imageshack.us/my.php?image=datako9.jpg

Does anybody know why?

Thanks, Bye