From d80827977afc8de009a4d21946a858daa53b74a4 Mon Sep 17 00:00:00 2001 From: Laurent Trinques Date: Sun, 12 Jul 2020 14:37:47 +0200 Subject: [PATCH] WIP Fix Qt::SystemLocaleShortDate this enum value is deprecated and shall be removed in Qt 6 --- sources/bordertitleblock.cpp | 2 +- sources/dataBase/projectdatabase.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/bordertitleblock.cpp b/sources/bordertitleblock.cpp index ede0f5ccd..39f3c5123 100644 --- a/sources/bordertitleblock.cpp +++ b/sources/bordertitleblock.cpp @@ -755,7 +755,7 @@ void BorderTitleBlock::updateDiagramContextForTitleBlock(const DiagramContext &i // ... overridden by the historical and/or dynamically generated fields context.addValue("author", btb_author_); - context.addValue("date", btb_date_.toString(Qt::SystemLocaleShortDate)); + context.addValue("date", btb_date_.toString(QLocale::system().toString(btb_date_, QLocale::ShortFormat))); context.addValue("title", btb_title_); context.addValue("filename", btb_filename_); context.addValue("plant", btb_plant_); diff --git a/sources/dataBase/projectdatabase.cpp b/sources/dataBase/projectdatabase.cpp index 93e3cea9c..affb98bd2 100644 --- a/sources/dataBase/projectdatabase.cpp +++ b/sources/dataBase/projectdatabase.cpp @@ -160,7 +160,7 @@ void projectDataBase::addDiagram(Diagram *diagram) for (auto key : QETApp::diagramInfoKeys()) { if (key == "date") { - m_insert_diagram_info_query.bindValue(":date", QDate::fromString(infos.value("date").toString(), Qt::SystemLocaleShortDate)); + m_insert_diagram_info_query.bindValue(":date", QDate::fromString(infos.value("date").toString(), QLocale::system().toString(QLocale::ShortFormat))); } else { auto value = infos.value(key); auto bind = key.prepend(":"); @@ -433,7 +433,7 @@ void projectDataBase::populateDiagramInfoTable() for (auto key : QETApp::diagramInfoKeys()) { if (key == "date") { - m_insert_diagram_info_query.bindValue(":date", QDate::fromString(infos.value("date").toString(), Qt::SystemLocaleShortDate)); + m_insert_diagram_info_query.bindValue(":date", QDate::fromString(infos.value("date").toString(), QLocale::system().toString(QLocale::ShortFormat))); } else { auto value = infos.value(key); auto bind = key.prepend(":"); -- 2.27.0