Surface: Use QStringLiteral

This commit is contained in:
Benjamin Bræstrup Sayoc
2025-02-09 18:28:50 +01:00
parent adf2051003
commit e0fb77bcdc
5 changed files with 42 additions and 46 deletions

View File

@@ -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<std::string>& 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<int>(GeomAbs_C0));
ui->comboBoxCont->addItem(QString::fromLatin1("G1"),
static_cast<int>(GeomAbs_G1));
ui->comboBoxCont->addItem(QString::fromLatin1("G2"),
static_cast<int>(GeomAbs_G2));
ui->comboBoxCont->addItem(QStringLiteral("C0"), static_cast<int>(GeomAbs_C0));
ui->comboBoxCont->addItem(QStringLiteral("G1"), static_cast<int>(GeomAbs_G1));
ui->comboBoxCont->addItem(QStringLiteral("G2"), static_cast<int>(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<std::string> 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<QVariant> data;