diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-26 12:13:21 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-05-27 02:54:29 (GMT) |
commit | 375ecd0038febc43b7de45005e14e410e6094726 (patch) | |
tree | 62ab3660abf8a056b9024ea327b5a36dce07ddbb | |
parent | 62f81f8fa5d84b7e258b7beb4a79b3573ba29d6f (diff) | |
download | Qt-375ecd0038febc43b7de45005e14e410e6094726.zip Qt-375ecd0038febc43b7de45005e14e410e6094726.tar.gz Qt-375ecd0038febc43b7de45005e14e410e6094726.tar.bz2 |
BT: opening datetimepicker in a cell in spreadsheet demo resets the date
That was a bug in the exemple.
Reviewed-by: Kavindra Palaraja
(cherry picked from commit 2c8348f5ccf62be31479dcd78282395a98eed76f)
-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 a33728d..04b070c 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")); } } } |