Base: Drop QString-std::string conversion functions from Tools

Convenience helpers function Tools::toStdString and Tools::fromStdString
were implemented for Qt4 or older to perform utf8 aware conversion as
QString::toStdString/QString::fromStdString were using toAscii/fromAscii
internally (see https://dreamswork.github.io/qt4/classQString.html).

Since Qt5 QString uses toUtf8/fromUTf8, which makes the helper functions
obsolete (see https://doc.qt.io/qt-5/qstring.html#fromStdString).
This commit is contained in:
Ladislav Michl
2024-12-02 12:34:11 +01:00
committed by Chris Hennes
parent 1a13d25811
commit e62b91ada4
54 changed files with 190 additions and 255 deletions

View File

@@ -27,7 +27,6 @@
#include <Base/Console.h>
#include <Base/Interpreter.h>
#include <Base/Tools.h>
#include <Gui/Application.h>
#include <Gui/Language/Translator.h>
#include <Gui/WidgetFactory.h>
@@ -90,7 +89,7 @@ void loadTechDrawResource()
{"osifont-lgpl3fe.ttf", "osifont-italic.ttf", "Y14.5-2018.ttf", "Y14.5-FreeCAD.ttf"});
for (auto& font : fontsAll) {
QString fontFile = Base::Tools::fromStdString(fontDir + font);
QString fontFile = QString::fromStdString(fontDir + font);
int rc = QFontDatabase::addApplicationFont(fontFile);
if (rc < 0) {
Base::Console().Warning(