diff --git a/src/Mod/Surface/Gui/TaskFilling.cpp b/src/Mod/Surface/Gui/TaskFilling.cpp index 81e303fc47..edaadb440c 100644 --- a/src/Mod/Surface/Gui/TaskFilling.cpp +++ b/src/Mod/Surface/Gui/TaskFilling.cpp @@ -284,7 +284,7 @@ FillingPanel::FillingPanel(ViewProviderFilling* vp, Surface::Filling* obj) // Create context menu QAction* action = new QAction(tr("Remove"), this); - action->setShortcut(QString::fromLatin1("Del")); + action->setShortcut(QStringLiteral("Del")); action->setShortcutContext(Qt::WidgetShortcut); ui->listBoundary->addAction(action); connect(action, &QAction::triggered, this, &FillingPanel::onDeleteEdge); @@ -341,9 +341,8 @@ void FillingPanel::setEditedObject(Surface::Filling* fea) App::DocumentObject* initFace = editedObject->InitialFace.getValue(); const std::vector& subList = editedObject->InitialFace.getSubValues(); if (initFace && subList.size() == 1) { - QString text = - QString::fromLatin1("%1.%2").arg(QString::fromUtf8(initFace->Label.getValue()), - QString::fromStdString(subList.front())); + QString text = QStringLiteral("%1.%2").arg(QString::fromUtf8(initFace->Label.getValue()), + QString::fromStdString(subList.front())); ui->lineInitFaceName->setText(text); } @@ -375,8 +374,8 @@ void FillingPanel::setEditedObject(Surface::Filling* fea) QListWidgetItem* item = new QListWidgetItem(ui->listBoundary); ui->listBoundary->addItem(item); - QString text = QString::fromLatin1("%1.%2").arg(QString::fromUtf8(obj->Label.getValue()), - QString::fromStdString(edge)); + QString text = QStringLiteral("%1.%2").arg(QString::fromUtf8(obj->Label.getValue()), + QString::fromStdString(edge)); item->setText(text); // The user data field of a list widget item @@ -605,17 +604,14 @@ void FillingPanel::onListBoundaryItemDoubleClicked(QListWidgetItem* item) // fill up the combo boxes modifyBoundary(true); ui->comboBoxFaces->addItem(tr("None"), QByteArray("")); - ui->comboBoxCont->addItem(QString::fromLatin1("C0"), - static_cast(GeomAbs_C0)); - ui->comboBoxCont->addItem(QString::fromLatin1("G1"), - static_cast(GeomAbs_G1)); - ui->comboBoxCont->addItem(QString::fromLatin1("G2"), - static_cast(GeomAbs_G2)); + ui->comboBoxCont->addItem(QStringLiteral("C0"), static_cast(GeomAbs_C0)); + ui->comboBoxCont->addItem(QStringLiteral("G1"), static_cast(GeomAbs_G1)); + ui->comboBoxCont->addItem(QStringLiteral("G2"), static_cast(GeomAbs_G2)); TopTools_ListIteratorOfListOfShape it(adj_faces); for (; it.More(); it.Next()) { const TopoDS_Shape& F = it.Value(); int index = faces.FindIndex(F); - QString text = QString::fromLatin1("Face%1").arg(index); + QString text = QStringLiteral("Face%1").arg(index); ui->comboBoxFaces->addItem(text, text.toLatin1()); } @@ -651,9 +647,9 @@ void FillingPanel::onSelectionChanged(const Gui::SelectionChanges& msg) checkOpenCommand(); if (selectionMode == InitFace) { Gui::SelectionObject sel(msg); - QString text = QString::fromLatin1("%1.%2").arg( - QString::fromUtf8(sel.getObject()->Label.getValue()), - QString::fromLatin1(msg.pSubName)); + QString text = + QStringLiteral("%1.%2").arg(QString::fromUtf8(sel.getObject()->Label.getValue()), + QString::fromLatin1(msg.pSubName)); ui->lineInitFaceName->setText(text); std::vector subList; @@ -673,9 +669,9 @@ void FillingPanel::onSelectionChanged(const Gui::SelectionChanges& msg) ui->listBoundary->addItem(item); Gui::SelectionObject sel(msg); - QString text = QString::fromLatin1("%1.%2").arg( - QString::fromUtf8(sel.getObject()->Label.getValue()), - QString::fromLatin1(msg.pSubName)); + QString text = + QStringLiteral("%1.%2").arg(QString::fromUtf8(sel.getObject()->Label.getValue()), + QString::fromLatin1(msg.pSubName)); item->setText(text); QList data; diff --git a/src/Mod/Surface/Gui/TaskFillingEdge.cpp b/src/Mod/Surface/Gui/TaskFillingEdge.cpp index 0bf76e99cf..b2501c73e3 100644 --- a/src/Mod/Surface/Gui/TaskFillingEdge.cpp +++ b/src/Mod/Surface/Gui/TaskFillingEdge.cpp @@ -133,7 +133,7 @@ FillingEdgePanel::FillingEdgePanel(ViewProviderFilling* vp, Surface::Filling* ob // Create context menu QAction* action = new QAction(tr("Remove"), this); - action->setShortcut(QString::fromLatin1("Del")); + action->setShortcut(QStringLiteral("Del")); action->setShortcutContext(Qt::WidgetShortcut); ui->listUnbound->addAction(action); connect(action, &QAction::triggered, this, &FillingEdgePanel::onDeleteUnboundEdge); @@ -213,8 +213,8 @@ void FillingEdgePanel::setEditedObject(Surface::Filling* fea) QListWidgetItem* item = new QListWidgetItem(ui->listUnbound); ui->listUnbound->addItem(item); - QString text = QString::fromLatin1("%1.%2").arg(QString::fromUtf8(obj->Label.getValue()), - QString::fromStdString(edge)); + QString text = QStringLiteral("%1.%2").arg(QString::fromUtf8(obj->Label.getValue()), + QString::fromStdString(edge)); item->setText(text); // The user data field of a list widget item @@ -388,17 +388,17 @@ void FillingEdgePanel::onListUnboundItemDoubleClicked(QListWidgetItem* item) // fill up the combo boxes modifyBoundary(true); ui->comboBoxUnboundFaces->addItem(tr("None"), QByteArray("")); - ui->comboBoxUnboundCont->addItem(QString::fromLatin1("C0"), + ui->comboBoxUnboundCont->addItem(QStringLiteral("C0"), static_cast(GeomAbs_C0)); - ui->comboBoxUnboundCont->addItem(QString::fromLatin1("G1"), + ui->comboBoxUnboundCont->addItem(QStringLiteral("G1"), static_cast(GeomAbs_G1)); - ui->comboBoxUnboundCont->addItem(QString::fromLatin1("G2"), + ui->comboBoxUnboundCont->addItem(QStringLiteral("G2"), static_cast(GeomAbs_G2)); TopTools_ListIteratorOfListOfShape it(adj_faces); for (; it.More(); it.Next()) { const TopoDS_Shape& F = it.Value(); int index = faces.FindIndex(F); - QString text = QString::fromLatin1("Face%1").arg(index); + QString text = QStringLiteral("Face%1").arg(index); ui->comboBoxUnboundFaces->addItem(text, text.toLatin1()); } @@ -437,9 +437,9 @@ void FillingEdgePanel::onSelectionChanged(const Gui::SelectionChanges& msg) ui->listUnbound->addItem(item); Gui::SelectionObject sel(msg); - QString text = QString::fromLatin1("%1.%2").arg( - QString::fromUtf8(sel.getObject()->Label.getValue()), - QString::fromLatin1(msg.pSubName)); + QString text = + QStringLiteral("%1.%2").arg(QString::fromUtf8(sel.getObject()->Label.getValue()), + QString::fromLatin1(msg.pSubName)); item->setText(text); QList data; diff --git a/src/Mod/Surface/Gui/TaskFillingVertex.cpp b/src/Mod/Surface/Gui/TaskFillingVertex.cpp index e214793e17..df1afc97fb 100644 --- a/src/Mod/Surface/Gui/TaskFillingVertex.cpp +++ b/src/Mod/Surface/Gui/TaskFillingVertex.cpp @@ -125,7 +125,7 @@ FillingVertexPanel::FillingVertexPanel(ViewProviderFilling* vp, Surface::Filling // Create context menu QAction* action = new QAction(tr("Remove"), this); - action->setShortcut(QString::fromLatin1("Del")); + action->setShortcut(QStringLiteral("Del")); action->setShortcutContext(Qt::WidgetShortcut); ui->listFreeVertex->addAction(action); connect(action, &QAction::triggered, this, &FillingVertexPanel::onDeleteVertex); @@ -175,8 +175,8 @@ void FillingVertexPanel::setEditedObject(Surface::Filling* obj) QListWidgetItem* item = new QListWidgetItem(ui->listFreeVertex); ui->listFreeVertex->addItem(item); - QString text = QString::fromLatin1("%1.%2").arg(QString::fromUtf8((*it)->Label.getValue()), - QString::fromStdString(*jt)); + QString text = QStringLiteral("%1.%2").arg(QString::fromUtf8((*it)->Label.getValue()), + QString::fromStdString(*jt)); item->setText(text); QList data; @@ -287,9 +287,9 @@ void FillingVertexPanel::onSelectionChanged(const Gui::SelectionChanges& msg) ui->listFreeVertex->addItem(item); Gui::SelectionObject sel(msg); - QString text = QString::fromLatin1("%1.%2").arg( - QString::fromUtf8(sel.getObject()->Label.getValue()), - QString::fromLatin1(msg.pSubName)); + QString text = + QStringLiteral("%1.%2").arg(QString::fromUtf8(sel.getObject()->Label.getValue()), + QString::fromLatin1(msg.pSubName)); item->setText(text); QList data; diff --git a/src/Mod/Surface/Gui/TaskGeomFillSurface.cpp b/src/Mod/Surface/Gui/TaskGeomFillSurface.cpp index ab4b794b97..9a1b1883cb 100644 --- a/src/Mod/Surface/Gui/TaskGeomFillSurface.cpp +++ b/src/Mod/Surface/Gui/TaskGeomFillSurface.cpp @@ -216,7 +216,7 @@ GeomFillSurface::GeomFillSurface(ViewProviderGeomFillSurface* vp, Surface::GeomF // Create context menu QAction* remove = new QAction(tr("Remove"), this); - remove->setShortcut(QString::fromLatin1("Del")); + remove->setShortcut(QStringLiteral("Del")); ui->listWidget->addAction(remove); connect(remove, &QAction::triggered, this, &GeomFillSurface::onDeleteEdge); @@ -307,8 +307,8 @@ void GeomFillSurface::setEditedObject(Surface::GeomFillSurface* obj) } ui->listWidget->addItem(item); - QString text = QString::fromLatin1("%1.%2").arg(QString::fromUtf8((*it)->Label.getValue()), - QString::fromStdString(*jt)); + QString text = QStringLiteral("%1.%2").arg(QString::fromUtf8((*it)->Label.getValue()), + QString::fromStdString(*jt)); item->setText(text); QList data; @@ -486,9 +486,9 @@ void GeomFillSurface::onSelectionChanged(const Gui::SelectionChanges& msg) ui->listWidget->addItem(item); Gui::SelectionObject sel(msg); - QString text = QString::fromLatin1("%1.%2").arg( - QString::fromUtf8(sel.getObject()->Label.getValue()), - QString::fromLatin1(msg.pSubName)); + QString text = + QStringLiteral("%1.%2").arg(QString::fromUtf8(sel.getObject()->Label.getValue()), + QString::fromLatin1(msg.pSubName)); item->setText(text); QList data; diff --git a/src/Mod/Surface/Gui/TaskSections.cpp b/src/Mod/Surface/Gui/TaskSections.cpp index 4a6ce1b354..d4b9d94057 100644 --- a/src/Mod/Surface/Gui/TaskSections.cpp +++ b/src/Mod/Surface/Gui/TaskSections.cpp @@ -326,8 +326,8 @@ void SectionsPanel::setEditedObject(Surface::Sections* fea) QListWidgetItem* item = new QListWidgetItem(ui->listSections); ui->listSections->addItem(item); - QString text = QString::fromLatin1("%1.%2").arg(QString::fromUtf8(obj->Label.getValue()), - QString::fromStdString(edge)); + QString text = QStringLiteral("%1.%2").arg(QString::fromUtf8(obj->Label.getValue()), + QString::fromStdString(edge)); item->setText(text); // The user data field of a list widget item @@ -475,9 +475,9 @@ void SectionsPanel::onSelectionChanged(const Gui::SelectionChanges& msg) ui->listSections->addItem(item); Gui::SelectionObject sel(msg); - QString text = QString::fromLatin1("%1.%2").arg( - QString::fromUtf8(sel.getObject()->Label.getValue()), - QString::fromLatin1(msg.pSubName)); + QString text = + QStringLiteral("%1.%2").arg(QString::fromUtf8(sel.getObject()->Label.getValue()), + QString::fromLatin1(msg.pSubName)); item->setText(text); QList data;