From fcd487e0ad098d1e6378f5de82372efbb4578cf2 Mon Sep 17 00:00:00 2001 From: Syres916 <46537884+Syres916@users.noreply.github.com> Date: Thu, 20 Nov 2025 16:28:04 +0000 Subject: [PATCH] [Gui] Fix string encoding document name and object name --- src/Gui/Tree.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 96df7570a3..a7569fae8d 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -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" +