From 2c8348f5ccf62be31479dcd78282395a98eed76f Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 26 May 2009 14:13:21 +0200 Subject: BT: opening datetimepicker in a cell in spreadsheet demo resets the date That was a bug in the exemple. Reviewed-by: Kavindra Palaraja --- demos/spreadsheet/spreadsheetdelegate.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demos/spreadsheet/spreadsheetdelegate.cpp b/demos/spreadsheet/spreadsheetdelegate.cpp index 465c92f..2916757 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(editor); if (dateEditor) { - model->setData(index, dateEditor->date().toString("dd/M/yyy")); + model->setData(index, dateEditor->date().toString("dd/M/yyyy")); } } } -- cgit v0.12