diff --git a/src/Mod/Mesh/Gui/Command.cpp b/src/Mod/Mesh/Gui/Command.cpp index 595bc84f33..c81e1e5ead 100644 --- a/src/Mod/Mesh/Gui/Command.cpp +++ b/src/Mod/Mesh/Gui/Command.cpp @@ -332,17 +332,17 @@ void CmdMeshImport::activated(int) { // use current path as default QStringList filter; - filter << QString::fromLatin1("%1 (*.stl *.ast *.bms *.obj *.off *.iv *.ply *.nas *.bdf)") + filter << QStringLiteral("%1 (*.stl *.ast *.bms *.obj *.off *.iv *.ply *.nas *.bdf)") .arg(QObject::tr("All Mesh Files")); - filter << QString::fromLatin1("%1 (*.stl)").arg(QObject::tr("Binary STL")); - filter << QString::fromLatin1("%1 (*.ast)").arg(QObject::tr("ASCII STL")); - filter << QString::fromLatin1("%1 (*.bms)").arg(QObject::tr("Binary Mesh")); - filter << QString::fromLatin1("%1 (*.obj)").arg(QObject::tr("Alias Mesh")); - filter << QString::fromLatin1("%1 (*.off)").arg(QObject::tr("Object File Format")); - filter << QString::fromLatin1("%1 (*.iv)").arg(QObject::tr("Inventor V2.1 ASCII")); - filter << QString::fromLatin1("%1 (*.ply)").arg(QObject::tr("Stanford Polygon")); - filter << QString::fromLatin1("%1 (*.nas *.bdf)").arg(QObject::tr("NASTRAN")); - filter << QString::fromLatin1("%1 (*.*)").arg(QObject::tr("All Files")); + filter << QStringLiteral("%1 (*.stl)").arg(QObject::tr("Binary STL")); + filter << QStringLiteral("%1 (*.ast)").arg(QObject::tr("ASCII STL")); + filter << QStringLiteral("%1 (*.bms)").arg(QObject::tr("Binary Mesh")); + filter << QStringLiteral("%1 (*.obj)").arg(QObject::tr("Alias Mesh")); + filter << QStringLiteral("%1 (*.off)").arg(QObject::tr("Object File Format")); + filter << QStringLiteral("%1 (*.iv)").arg(QObject::tr("Inventor V2.1 ASCII")); + filter << QStringLiteral("%1 (*.ply)").arg(QObject::tr("Stanford Polygon")); + filter << QStringLiteral("%1 (*.nas *.bdf)").arg(QObject::tr("NASTRAN")); + filter << QStringLiteral("%1 (*.*)").arg(QObject::tr("All Files")); // Allow multi selection QStringList fn = Gui::FileDialog::getOpenFileNames(Gui::getMainWindow(), @@ -394,25 +394,25 @@ void CmdMeshExport::activated(int) // clang-format off QString dir = QString::fromUtf8(docObj->Label.getValue()); QList > ext; - ext << qMakePair(QString::fromLatin1("%1 (*.stl)").arg(QObject::tr("Binary STL")), "STL"); - ext << qMakePair(QString::fromLatin1("%1 (*.stl)").arg(QObject::tr("ASCII STL")), "AST"); - ext << qMakePair(QString::fromLatin1("%1 (*.ast)").arg(QObject::tr("ASCII STL")), "AST"); - ext << qMakePair(QString::fromLatin1("%1 (*.bms)").arg(QObject::tr("Binary Mesh")), "BMS"); - ext << qMakePair(QString::fromLatin1("%1 (*.obj)").arg(QObject::tr("Alias Mesh")), "OBJ"); - ext << qMakePair(QString::fromLatin1("%1 (*.smf)").arg(QObject::tr("Simple Model Format")), "SMF"); - ext << qMakePair(QString::fromLatin1("%1 (*.off)").arg(QObject::tr("Object File Format")), "OFF"); - ext << qMakePair(QString::fromLatin1("%1 (*.iv)").arg(QObject::tr("Inventor V2.1 ascii")), "IV"); - ext << qMakePair(QString::fromLatin1("%1 (*.x3d)").arg(QObject::tr("X3D Extensible 3D")), "X3D"); - ext << qMakePair(QString::fromLatin1("%1 (*.x3dz)").arg(QObject::tr("Compressed X3D")), "X3DZ"); - ext << qMakePair(QString::fromLatin1("%1 (*.xhtml)").arg(QObject::tr("WebGL/X3D")), "X3DOM"); - ext << qMakePair(QString::fromLatin1("%1 (*.ply)").arg(QObject::tr("Stanford Polygon")), "PLY"); - ext << qMakePair(QString::fromLatin1("%1 (*.wrl *.vrml)").arg(QObject::tr("VRML V2.0")), "VRML"); - ext << qMakePair(QString::fromLatin1("%1 (*.wrz)").arg(QObject::tr("Compressed VRML 2.0")), "WRZ"); - ext << qMakePair(QString::fromLatin1("%1 (*.nas *.bdf)").arg(QObject::tr("Nastran")), "NAS"); - ext << qMakePair(QString::fromLatin1("%1 (*.py)").arg(QObject::tr("Python module def")), "PY"); - ext << qMakePair(QString::fromLatin1("%1 (*.asy)").arg(QObject::tr("Asymptote Format")), "ASY"); - ext << qMakePair(QString::fromLatin1("%1 (*.3mf)").arg(QObject::tr("3D Manufacturing Format")), "3MF"); - ext << qMakePair(QString::fromLatin1("%1 (*.*)").arg(QObject::tr("All Files")), ""); // Undefined + ext << qMakePair(QStringLiteral("%1 (*.stl)").arg(QObject::tr("Binary STL")), "STL"); + ext << qMakePair(QStringLiteral("%1 (*.stl)").arg(QObject::tr("ASCII STL")), "AST"); + ext << qMakePair(QStringLiteral("%1 (*.ast)").arg(QObject::tr("ASCII STL")), "AST"); + ext << qMakePair(QStringLiteral("%1 (*.bms)").arg(QObject::tr("Binary Mesh")), "BMS"); + ext << qMakePair(QStringLiteral("%1 (*.obj)").arg(QObject::tr("Alias Mesh")), "OBJ"); + ext << qMakePair(QStringLiteral("%1 (*.smf)").arg(QObject::tr("Simple Model Format")), "SMF"); + ext << qMakePair(QStringLiteral("%1 (*.off)").arg(QObject::tr("Object File Format")), "OFF"); + ext << qMakePair(QStringLiteral("%1 (*.iv)").arg(QObject::tr("Inventor V2.1 ascii")), "IV"); + ext << qMakePair(QStringLiteral("%1 (*.x3d)").arg(QObject::tr("X3D Extensible 3D")), "X3D"); + ext << qMakePair(QStringLiteral("%1 (*.x3dz)").arg(QObject::tr("Compressed X3D")), "X3DZ"); + ext << qMakePair(QStringLiteral("%1 (*.xhtml)").arg(QObject::tr("WebGL/X3D")), "X3DOM"); + ext << qMakePair(QStringLiteral("%1 (*.ply)").arg(QObject::tr("Stanford Polygon")), "PLY"); + ext << qMakePair(QStringLiteral("%1 (*.wrl *.vrml)").arg(QObject::tr("VRML V2.0")), "VRML"); + ext << qMakePair(QStringLiteral("%1 (*.wrz)").arg(QObject::tr("Compressed VRML 2.0")), "WRZ"); + ext << qMakePair(QStringLiteral("%1 (*.nas *.bdf)").arg(QObject::tr("Nastran")), "NAS"); + ext << qMakePair(QStringLiteral("%1 (*.py)").arg(QObject::tr("Python module def")), "PY"); + ext << qMakePair(QStringLiteral("%1 (*.asy)").arg(QObject::tr("Asymptote Format")), "ASY"); + ext << qMakePair(QStringLiteral("%1 (*.3mf)").arg(QObject::tr("3D Manufacturing Format")), "3MF"); + ext << qMakePair(QStringLiteral("%1 (*.*)").arg(QObject::tr("All Files")), ""); // Undefined // clang-format on QStringList filter; for (const auto& it : ext) { @@ -1459,7 +1459,7 @@ void CmdMeshBoundingBox::activated(int) QString bound = qApp->translate("Mesh_BoundingBox", "Boundings of %1:") .arg(QString::fromUtf8(it->Label.getValue())); - bound += QString::fromLatin1("\n\nMin=<%1,%2,%3>\n\nMax=<%4,%5,%6>") + bound += QStringLiteral("\n\nMin=<%1,%2,%3>\n\nMax=<%4,%5,%6>") .arg(box.MinX) .arg(box.MinY) .arg(box.MinZ) diff --git a/src/Mod/Mesh/Gui/DlgDecimating.cpp b/src/Mod/Mesh/Gui/DlgDecimating.cpp index f4f49a9335..fd759bfc02 100644 --- a/src/Mod/Mesh/Gui/DlgDecimating.cpp +++ b/src/Mod/Mesh/Gui/DlgDecimating.cpp @@ -97,7 +97,7 @@ void DlgDecimating::onCheckAbsoluteNumberToggled(bool on) else { ui->spinBoxReduction->setRange(0, 100); ui->spinBoxReduction->setValue(ui->sliderReduction->value()); - ui->spinBoxReduction->setSuffix(QString::fromLatin1("%")); + ui->spinBoxReduction->setSuffix(QStringLiteral("%")); ui->checkAbsoluteNumber->setText(tr("Absolute number")); connect(ui->sliderReduction, qOverload(&QSlider::valueChanged), diff --git a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp index 0448d68461..c26f66c7cd 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp +++ b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp @@ -439,9 +439,9 @@ void DlgEvaluateMeshImp::showInformation() if (d->meshFeature) { const MeshKernel& rMesh = d->meshFeature->Mesh.getValue().getKernel(); - d->ui.textLabel4->setText(QString::fromLatin1("%1").arg(rMesh.CountFacets())); - d->ui.textLabel5->setText(QString::fromLatin1("%1").arg(rMesh.CountEdges())); - d->ui.textLabel6->setText(QString::fromLatin1("%1").arg(rMesh.CountPoints())); + d->ui.textLabel4->setText(QStringLiteral("%1").arg(rMesh.CountFacets())); + d->ui.textLabel5->setText(QStringLiteral("%1").arg(rMesh.CountEdges())); + d->ui.textLabel6->setText(QStringLiteral("%1").arg(rMesh.CountPoints())); } } @@ -1278,7 +1278,7 @@ void DlgEvaluateMeshImp::onRepairAllTogetherClicked() QMessageBox::warning(this, tr("Mesh repair"), QString::fromLatin1(e.what())); } catch (...) { - QMessageBox::warning(this, tr("Mesh repair"), QString::fromLatin1("Unknown error occurred.")); + QMessageBox::warning(this, tr("Mesh repair"), QStringLiteral("Unknown error occurred.")); } doc->commitCommand(); diff --git a/src/Mod/Mesh/Gui/RemeshGmsh.cpp b/src/Mod/Mesh/Gui/RemeshGmsh.cpp index 35b6362ef5..f6aa7f480b 100644 --- a/src/Mod/Mesh/Gui/RemeshGmsh.cpp +++ b/src/Mod/Mesh/Gui/RemeshGmsh.cpp @@ -98,9 +98,9 @@ GmshWidget::GmshWidget(QWidget* parent, Qt::WindowFlags fl) d->ui.method->addItem(tr("Automatic"), static_cast(Automatic)); d->ui.method->addItem(tr("Adaptive"), static_cast(MeshAdapt)); - d->ui.method->addItem(QString::fromLatin1("Delaunay"), static_cast(Delaunay)); + d->ui.method->addItem(QStringLiteral("Delaunay"), static_cast(Delaunay)); d->ui.method->addItem(tr("Frontal"), static_cast(FrontalDelaunay)); - d->ui.method->addItem(QString::fromLatin1("BAMG"), static_cast(BAMG)); + d->ui.method->addItem(QStringLiteral("BAMG"), static_cast(BAMG)); d->ui.method->addItem(tr("Frontal Quad"), static_cast(FrontalDelaunayForQuads)); d->ui.method->addItem(tr("Parallelograms"), static_cast(PackingOfParallelograms)); d->ui.method->addItem(tr("Quasi-structured Quad"), static_cast(QuasiStructuredQuad)); @@ -252,8 +252,7 @@ void GmshWidget::finished(int /*exitCode*/, QProcess::ExitStatus exitStatus) d->label->close(); } - d->ui.labelTime->setText( - QString::fromLatin1("%1 %2 ms").arg(tr("Time:")).arg(d->time.elapsed())); + d->ui.labelTime->setText(QStringLiteral("%1 %2 ms").arg(tr("Time:")).arg(d->time.elapsed())); if (exitStatus == QProcess::NormalExit) { loadOutput(); } diff --git a/src/Mod/Mesh/Gui/SegmentationBestFit.cpp b/src/Mod/Mesh/Gui/SegmentationBestFit.cpp index c3a020238a..f0e67d81b0 100644 --- a/src/Mod/Mesh/Gui/SegmentationBestFit.cpp +++ b/src/Mod/Mesh/Gui/SegmentationBestFit.cpp @@ -190,25 +190,25 @@ ParametersDialog::ParametersDialog(std::vector& val, QPushButton* regionButton {}; regionButton = new QPushButton(this); regionButton->setText(tr("Region")); - regionButton->setObjectName(QString::fromLatin1("region")); + regionButton->setObjectName(QStringLiteral("region")); selectLayout->addWidget(regionButton); QPushButton* singleButton {}; singleButton = new QPushButton(this); singleButton->setText(tr("Triangle")); - singleButton->setObjectName(QString::fromLatin1("single")); + singleButton->setObjectName(QStringLiteral("single")); selectLayout->addWidget(singleButton); QPushButton* clearButton {}; clearButton = new QPushButton(this); clearButton->setText(tr("Clear")); - clearButton->setObjectName(QString::fromLatin1("clear")); + clearButton->setObjectName(QStringLiteral("clear")); selectLayout->addWidget(clearButton); QPushButton* computeButton {}; computeButton = new QPushButton(this); computeButton->setText(tr("Compute")); - computeButton->setObjectName(QString::fromLatin1("compute")); + computeButton->setObjectName(QStringLiteral("compute")); gridLayout->addWidget(computeButton, 2, 0, 1, 1); QDialogButtonBox* buttonBox {}; @@ -373,9 +373,9 @@ void SegmentationBestFit::onPlaneParametersClicked() p.resize(6); QString base = tr("Base"); QString axis = tr("Normal"); - QString x = QString::fromLatin1(" x"); - QString y = QString::fromLatin1(" y"); - QString z = QString::fromLatin1(" z"); + QString x = QStringLiteral(" x"); + QString y = QStringLiteral(" y"); + QString z = QStringLiteral(" z"); list.push_back(std::make_pair(base + x, p[0])); list.push_back(std::make_pair(base + y, p[1])); list.push_back(std::make_pair(base + z, p[2])); @@ -399,9 +399,9 @@ void SegmentationBestFit::onCylinderParametersClicked() QString base = tr("Base"); QString axis = tr("Axis"); QString radius = tr("Radius"); - QString x = QString::fromLatin1(" x"); - QString y = QString::fromLatin1(" y"); - QString z = QString::fromLatin1(" z"); + QString x = QStringLiteral(" x"); + QString y = QStringLiteral(" y"); + QString z = QStringLiteral(" z"); list.push_back(std::make_pair(base + x, p[0])); list.push_back(std::make_pair(base + y, p[1])); list.push_back(std::make_pair(base + z, p[2])); @@ -426,9 +426,9 @@ void SegmentationBestFit::onSphereParametersClicked() p.resize(4); QString base = tr("Center"); QString radius = tr("Radius"); - QString x = QString::fromLatin1(" x"); - QString y = QString::fromLatin1(" y"); - QString z = QString::fromLatin1(" z"); + QString x = QStringLiteral(" x"); + QString y = QStringLiteral(" y"); + QString z = QStringLiteral(" z"); list.push_back(std::make_pair(base + x, p[0])); list.push_back(std::make_pair(base + y, p[1])); list.push_back(std::make_pair(base + z, p[2])); diff --git a/src/Mod/Mesh/Gui/ViewProvider.cpp b/src/Mod/Mesh/Gui/ViewProvider.cpp index 620f82d049..ac7dc30651 100644 --- a/src/Mod/Mesh/Gui/ViewProvider.cpp +++ b/src/Mod/Mesh/Gui/ViewProvider.cpp @@ -1746,8 +1746,8 @@ void ViewProviderMesh::faceInfoCallback(void* ud, SoEventCallback* cb) static_cast(faceDetail->getPoint(2))->getCoordinateIndex(); auto flag = new Gui::Flag; flag->setText(QObject::tr("Index: %1").arg(uFacet)); - QString toolTip = QString::fromLatin1("Facet index: %1\n" - "Points: <%2, %3, %4>") + QString toolTip = QStringLiteral("Facet index: %1\n" + "Points: <%2, %3, %4>") .arg(uFacet) .arg(point1) .arg(point2) diff --git a/src/Mod/Mesh/Gui/Workbench.cpp b/src/Mod/Mesh/Gui/Workbench.cpp index 92824d07ac..cab5a9c0c8 100644 --- a/src/Mod/Mesh/Gui/Workbench.cpp +++ b/src/Mod/Mesh/Gui/Workbench.cpp @@ -122,10 +122,10 @@ public: numMax->setText(tr("X: %1\tY: %2\tZ: %3").arg(bbox.MaxX).arg(bbox.MaxY).arg(bbox.MaxZ)); } else { - numPoints->setText(QString::fromLatin1("")); - numFacets->setText(QString::fromLatin1("")); - numMin->setText(QString::fromLatin1("")); - numMax->setText(QString::fromLatin1("")); + numPoints->setText(QStringLiteral("")); + numFacets->setText(QStringLiteral("")); + numMin->setText(QStringLiteral("")); + numMax->setText(QStringLiteral("")); } }