mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Fix date on summary pages
This commit is contained in:
@@ -162,11 +162,23 @@ void projectDataBase::addDiagram(Diagram *diagram)
|
|||||||
for (auto key : QETApp::diagramInfoKeys())
|
for (auto key : QETApp::diagramInfoKeys())
|
||||||
{
|
{
|
||||||
if (key == "date") {
|
if (key == "date") {
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||||
|
m_insert_diagram_info_query.bindValue(
|
||||||
|
":date",
|
||||||
|
QDate::fromString(
|
||||||
|
infos.value("date").toString(),
|
||||||
|
Qt::SystemLocaleShortDate));
|
||||||
|
#else
|
||||||
|
#if TODO_LIST
|
||||||
|
#pragma message("@TODO remove code for QT 6.0 or later")
|
||||||
|
#endif
|
||||||
m_insert_diagram_info_query.bindValue(
|
m_insert_diagram_info_query.bindValue(
|
||||||
":date",
|
":date",
|
||||||
QLocale::system().toString(
|
QLocale::system().toString(
|
||||||
infos.value("date").toDate(),
|
infos.value("date").toDate(),
|
||||||
QLocale::ShortFormat));
|
QLocale::ShortFormat));
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
auto value = infos.value(key);
|
auto value = infos.value(key);
|
||||||
auto bind = key.prepend(":");
|
auto bind = key.prepend(":");
|
||||||
@@ -424,11 +436,22 @@ void projectDataBase::populateDiagramInfoTable()
|
|||||||
for (auto key : QETApp::diagramInfoKeys())
|
for (auto key : QETApp::diagramInfoKeys())
|
||||||
{
|
{
|
||||||
if (key == "date") {
|
if (key == "date") {
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||||
|
m_insert_diagram_info_query.bindValue(
|
||||||
|
":date",
|
||||||
|
QDate::fromString(
|
||||||
|
infos.value("date").toString(),
|
||||||
|
Qt::SystemLocaleShortDate));
|
||||||
|
#else
|
||||||
|
#if TODO_LIST
|
||||||
|
#pragma message("@TODO remove code for QT 6.0 or later")
|
||||||
|
#endif
|
||||||
m_insert_diagram_info_query.bindValue(
|
m_insert_diagram_info_query.bindValue(
|
||||||
":date",
|
":date",
|
||||||
QLocale::system().toString(
|
QLocale::system().toString(
|
||||||
infos.value("date").toDate(),
|
infos.value("date").toDate(),
|
||||||
QLocale::ShortFormat));
|
QLocale::ShortFormat));
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
auto value = infos.value(key);
|
auto value = infos.value(key);
|
||||||
auto bind = key.prepend(":");
|
auto bind = key.prepend(":");
|
||||||
|
|||||||
Reference in New Issue
Block a user