diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-26 14:13:21 +0200 |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-26 14:22:32 +0200 |
commit | 2c8348f5ccf62be31479dcd78282395a98eed76f (patch) | |
tree | 7cfb2bb9df844c98472decc2e449b6045196e4e0 | |
parent | aec18b0eea741da58a02f7ad95ab5ee9dccfce6c (diff) | |
download | qt4-tools-2c8348f5ccf62be31479dcd78282395a98eed76f.tar.gz |
BT: opening datetimepicker in a cell in spreadsheet demo resets the date
That was a bug in the exemple.
Reviewed-by: Kavindra Palaraja
-rw-r--r-- | demos/spreadsheet/spreadsheetdelegate.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/demos/spreadsheet/spreadsheetdelegate.cpp b/demos/spreadsheet/spreadsheetdelegate.cpp index 465c92f34d..291675700f 100644 --- a/demos/spreadsheet/spreadsheetdelegate.cpp +++ b/demos/spreadsheet/spreadsheetdelegate.cpp @@ -51,7 +51,7 @@ QWidget *SpreadSheetDelegate::createEditor(QWidget *parent, { if (index.column() == 1) { QDateTimeEdit *editor = new QDateTimeEdit(parent); - editor->setDisplayFormat("dd/M/yyy"); + editor->setDisplayFormat("dd/M/yyyy"); editor->setCalendarPopup(true); return editor; } @@ -93,7 +93,7 @@ void SpreadSheetDelegate::setEditorData(QWidget *editor, if (dateEditor) { dateEditor->setDate(QDate::fromString( index.model()->data(index, Qt::EditRole).toString(), - "d/M/yy")); + "d/M/yyyy")); } } } @@ -107,7 +107,7 @@ void SpreadSheetDelegate::setModelData(QWidget *editor, } else { QDateTimeEdit *dateEditor = qobject_cast<QDateTimeEdit *>(editor); if (dateEditor) { - model->setData(index, dateEditor->date().toString("dd/M/yyy")); + model->setData(index, dateEditor->date().toString("dd/M/yyyy")); } } } |