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 f9d1391588
commit 0ee3c9f8e6
54 changed files with 190 additions and 255 deletions

View File

@@ -26,7 +26,6 @@
#endif
#include <App/DocumentObject.h>
#include <Base/Tools.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Mod/TechDraw/App/DrawViewBalloon.h>
@@ -84,13 +83,13 @@ void TaskCustomizeFormat::setUiEdit()
isDimension = true;
std::string dimText = dim->FormatSpec.getStrValue();
dimRawValue = dim->getDimValue();
ui->leFormat->setText(Base::Tools::fromStdString(dimText));
ui->leFormat->setText(QString::fromStdString(dimText));
}
else if (auto balloon = dynamic_cast<TechDraw::DrawViewBalloon*>(selectedObject))
{
isDimension = false;
std::string balloonText = balloon->Text.getStrValue();
ui->leFormat->setText(Base::Tools::fromStdString(balloonText));
ui->leFormat->setText(QString::fromStdString(balloonText));
}
// GD&T
connect(ui->pbA01, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked);