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:
committed by
Chris Hennes
parent
f9d1391588
commit
0ee3c9f8e6
@@ -27,7 +27,6 @@
|
||||
#endif
|
||||
|
||||
#include <Base/Console.h> // for FC_LOG_LEVEL_INIT
|
||||
#include <Base/Tools.h>
|
||||
|
||||
#include "DlgPageChooser.h"
|
||||
#include "ui_DlgPageChooser.h"
|
||||
@@ -72,8 +71,8 @@ void DlgPageChooser::fillList(std::vector<std::string> labels, std::vector<std::
|
||||
int labelCount = labels.size();
|
||||
int i = 0;
|
||||
for (; i < labelCount; i++) {
|
||||
qLabel = Base::Tools::fromStdString(labels[i]);
|
||||
qName = Base::Tools::fromStdString(names[i]);
|
||||
qLabel = QString::fromStdString(labels[i]);
|
||||
qName = QString::fromStdString(names[i]);
|
||||
qText = QString::fromUtf8("%1 (%2)").arg(qLabel, qName);
|
||||
item = new QListWidgetItem(qText, ui->lwPages);
|
||||
item->setData(Qt::UserRole, qName);
|
||||
|
||||
Reference in New Issue
Block a user