From 7ce0a0bf0ea7ea08e3a73da2a807b8a9d66bd375 Mon Sep 17 00:00:00 2001 From: Syres916 <46537884+Syres916@users.noreply.github.com> Date: Wed, 19 Nov 2025 23:43:52 +0000 Subject: [PATCH] [Gui] Fix incorrect document name when updating PropertyLink --- src/Gui/Dialogs/DlgPropertyLink.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Gui/Dialogs/DlgPropertyLink.cpp b/src/Gui/Dialogs/DlgPropertyLink.cpp index 955c4d2b54..4e52e6cf60 100644 --- a/src/Gui/Dialogs/DlgPropertyLink.cpp +++ b/src/Gui/Dialogs/DlgPropertyLink.cpp @@ -745,7 +745,7 @@ void DlgPropertyLink::onSelectionChanged(const Gui::SelectionChanges& msg) ui->treeWidget->scrollToItem(item); if (allowSubObject) { - QString element = QString::fromLatin1(msg.Object.getOldElementName().c_str()); + QString element = QString::fromUtf8(msg.Object.getOldElementName().c_str()); if (element.size()) { QStringList list; QString text = item->text(1); @@ -868,7 +868,7 @@ QString DlgPropertyLink::linksToPython(const QList& links) } if (links.size() == 1) { - return QString::fromLatin1(links.front().getSubObjectPython(false).c_str()); + return QString::fromUtf8(links.front().getSubObjectPython(false).c_str()); } std::ostringstream ss; @@ -891,7 +891,7 @@ QString DlgPropertyLink::linksToPython(const QList& links) ss << ']'; } - return QString::fromLatin1(ss.str().c_str()); + return QString::fromUtf8(ss.str().c_str()); } void DlgPropertyLink::filterObjects() @@ -1114,7 +1114,7 @@ QTreeWidgetItem* DlgPropertyLink::createTypeItem(Base::Type type) item = new QTreeWidgetItem(item); } item->setExpanded(true); - item->setText(0, QString::fromLatin1(type.getName())); + item->setText(0, QString::fromUtf8(type.getName())); if (type == App::DocumentObject::getClassTypeId()) { item->setFlags(Qt::ItemIsEnabled); } @@ -1129,7 +1129,7 @@ bool DlgPropertyLink::filterType(QTreeWidgetItem* item) auto& pitem = typeItems[proxyType]; if (!pitem) { pitem = new QTreeWidgetItem(ui->typeTree); - pitem->setText(0, QString::fromLatin1(proxyType)); + pitem->setText(0, QString::fromUtf8(proxyType)); pitem->setIcon(0, item->icon(0)); pitem->setData(0, Qt::UserRole, proxyType); }