Gui: Use QStringLiteral

This commit is contained in:
Benjamin Bræstrup Sayoc
2025-02-09 18:33:01 +01:00
parent 24ac19e261
commit 8d2d0a47f4
83 changed files with 519 additions and 520 deletions

View File

@@ -439,7 +439,7 @@ TreeWidgetItemDelegate::TreeWidgetItemDelegate(QObject* parent)
: QStyledItemDelegate(parent)
{
artificial = new QTreeView(qobject_cast<QWidget*>(parent));
artificial->setObjectName(QString::fromLatin1("DocumentTreeItems"));
artificial->setObjectName(QStringLiteral("DocumentTreeItems"));
artificial->setFixedSize(0, 0); // ensure that it does not render
}
@@ -1201,7 +1201,7 @@ void TreeWidget::onCreateGroup()
if (this->contextItem->type() == DocumentType) {
auto docitem = static_cast<DocumentItem*>(this->contextItem);
App::Document* doc = docitem->document()->getDocument();
QString cmd = QString::fromLatin1("App.getDocument(\"%1\").addObject"
QString cmd = QStringLiteral("App.getDocument(\"%1\").addObject"
"(\"App::DocumentObjectGroup\",\"Group\").Label=\"%2\"")
.arg(QString::fromLatin1(doc->getName()), name);
Gui::Command::runCommand(Gui::Command::App, cmd.toUtf8());
@@ -1211,7 +1211,7 @@ void TreeWidget::onCreateGroup()
(this->contextItem);
App::DocumentObject* obj = objitem->object()->getObject();
App::Document* doc = obj->getDocument();
QString cmd = QString::fromLatin1("App.getDocument(\"%1\").getObject(\"%2\")"
QString cmd = QStringLiteral("App.getDocument(\"%1\").getObject(\"%2\")"
".newObject(\"App::DocumentObjectGroup\",\"Group\").Label=\"%3\"")
.arg(QString::fromLatin1(doc->getName()),
QString::fromLatin1(obj->getNameInDocument()),