From 3d9f10fa97f36a7344d59e1658bbf418f5a5f290 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Tue, 19 Aug 2014 15:15:36 +1000 Subject: [PATCH] CMS50I datetime fix --- sleepyhead/oximeterimport.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sleepyhead/oximeterimport.cpp b/sleepyhead/oximeterimport.cpp index 652dcda0..05638147 100644 --- a/sleepyhead/oximeterimport.cpp +++ b/sleepyhead/oximeterimport.cpp @@ -251,6 +251,7 @@ void OximeterImport::on_directImportButton_clicked() item = new QTableWidgetItem(datetime.date().toString(Qt::SystemLocaleShortDate)+" "+datetime.time().toString("HH:mm:ss")); ui->tableOxiSessions->setItem(i, 0, item); + item->setData(Qt::UserRole+1, datetime); item->setData(Qt::UserRole, i); item->setFlags(item->flags() & ~Qt::ItemIsEditable); @@ -990,7 +991,7 @@ void OximeterImport::on_chooseSessionButton_clicked() QTableWidgetItem * item = ui->tableOxiSessions->item(ui->tableOxiSessions->currentRow(),0); if (!item) return; - QDateTime datetime = QDateTime::fromString(item->text(), Qt::ISODate); + QDateTime datetime = item->data(Qt::UserRole+1).toDateTime(); oximodule->setStartTime(datetime); if (selecting_session) {