summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-05-26 12:13:21 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-05-26 12:22:32 (GMT)
commit2c8348f5ccf62be31479dcd78282395a98eed76f (patch)
tree7cfb2bb9df844c98472decc2e449b6045196e4e0 /demos
parentaec18b0eea741da58a02f7ad95ab5ee9dccfce6c (diff)
downloadQt-2c8348f5ccf62be31479dcd78282395a98eed76f.zip
Qt-2c8348f5ccf62be31479dcd78282395a98eed76f.tar.gz
Qt-2c8348f5ccf62be31479dcd78282395a98eed76f.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
Diffstat (limited to 'demos')
-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 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<QDateTimeEdit *>(editor);
if (dateEditor) {
- model->setData(index, dateEditor->date().toString("dd/M/yyy"));
+ model->setData(index, dateEditor->date().toString("dd/M/yyyy"));
}
}
}