[Gui] Fix string encoding document name and object name

This commit is contained in:
Syres916
2025-11-20 16:28:04 +00:00
committed by GitHub
parent 093a070439
commit fcd487e0ad

View File

@@ -1357,7 +1357,7 @@ void TreeWidget::onCreateGroup()
"App.getDocument(\"%1\").addObject"
"(\"App::DocumentObjectGroup\",\"Group\").Label=\"%2\""
)
.arg(QString::fromLatin1(doc->getName()), name);
.arg(QString::fromUtf8(doc->getName()), name);
Gui::Command::runCommand(Gui::Command::App, cmd.toUtf8());
}
else if (this->contextItem->type() == ObjectType) {
@@ -1369,8 +1369,8 @@ void TreeWidget::onCreateGroup()
".newObject(\"App::DocumentObjectGroup\",\"Group\").Label=\"%3\""
)
.arg(
QString::fromLatin1(doc->getName()),
QString::fromLatin1(obj->getNameInDocument()),
QString::fromUtf8(doc->getName()),
QString::fromUtf8(obj->getNameInDocument()),
name
);
Gui::Command::runCommand(Gui::Command::App, cmd.toUtf8());
@@ -6689,3 +6689,4 @@ void DocumentObjectItem::applyExpandedSnapshot(
}
#include "moc_Tree.cpp"