summaryrefslogtreecommitdiffstats
path: root/demos/spreadsheet
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-05-26 14:13:21 +0200
committerOlivier Goffart <ogoffart@trolltech.com>2009-05-26 14:22:32 +0200
commit2c8348f5ccf62be31479dcd78282395a98eed76f (patch)
tree7cfb2bb9df844c98472decc2e449b6045196e4e0 /demos/spreadsheet
parentaec18b0eea741da58a02f7ad95ab5ee9dccfce6c (diff)
BT: opening datetimepicker in a cell in spreadsheet demo resets the date
That was a bug in the exemple. Reviewed-by: Kavindra Palaraja
Diffstat (limited to 'demos/spreadsheet')
-rw-r--r--demos/spreadsheet/spreadsheetdelegate.cpp6
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"));
}
}
}