Fix Qt 6 deprecated Qt::SystemLocaleShortDate

The format options
Qt::SystemLocaleDate, Qt::SystemLocaleShortDate
and Qt::SystemLocaleLongDate
shall be removed in Qt 6.
	Their use should be replaced with
QLocale::system().toString(date, QLocale::ShortFormat)
or
QLocale::system().toString(date, QLocale::LongFormat).
This commit is contained in:
Simon De Backer
2020-09-21 20:23:20 +02:00
parent f21cdb4040
commit c7ffae7918
3 changed files with 82 additions and 64 deletions

View File

@@ -17,6 +17,8 @@
*/
#include <QPainter>
#include <utility>
#include <QLocale>
#include "titleblocktemplate.h"
#include "titleblocktemplaterenderer.h"
#include "bordertitleblock.h"
@@ -934,9 +936,12 @@ void BorderTitleBlock::updateDiagramContextForTitleBlock(
}
// ... overridden by the historical and/or dynamically generated fields
QLocale var;
var.dateFormat(QLocale::ShortFormat);
context.addValue("author", btb_author_);
context.addValue("date", btb_date_.toString(
Qt::SystemLocaleShortDate));
context.addValue(
"date",
QLocale::system().toString(btb_date_, QLocale::ShortFormat));
context.addValue("title", btb_title_);
context.addValue("filename", btb_filename_);
context.addValue("plant", btb_plant_);