From 47c9f01d22b6a22a3298bf7f58abf23dfbe3c825 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 2 Jun 2020 20:15:42 +0200 Subject: [PATCH] Gui: [skip ci] handle unicode in tool tips of tree view --- src/Gui/Tree.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 800ca145c0..12f112025e 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -4655,12 +4655,17 @@ void DocumentObjectItem::displayStatusInfo() { App::DocumentObject* Obj = object()->getObject(); - QString info = QString::fromLatin1(Obj->getStatusString()); - if ( Obj->mustExecute() == 1 && !Obj->isError()) - info += QString::fromLatin1(" (but must be executed)"); +#if (QT_VERSION >= 0x050000) + QString info = QApplication::translate(Obj->getTypeId().getName(), Obj->getStatusString()); +#else + QString info = QApplication::translate(Obj->getTypeId().getName(), Obj->getStatusString(), 0, QApplication::UnicodeUTF8); +#endif + + if (Obj->mustExecute() == 1 && !Obj->isError()) + info += TreeWidget::tr(" (but must be executed)"); + QString status = TreeWidget::tr("%1, Internal name: %2") - .arg(info, - QString::fromLatin1(Obj->getNameInDocument())); + .arg(info, QString::fromLatin1(Obj->getNameInDocument())); if (!Obj->isError()) getMainWindow()->showMessage(status);