diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 83ec217cca..c6b8bd3044 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -598,7 +598,7 @@ void PropertyItem::setPropertyName(const QString& name, const QString& realName) displayText = str; } -void PropertyItem::setPropertyValue(const QString& value) +void PropertyItem::setPropertyValue(const std::string& value) { // Construct command for property assignment in one go, in case of any // intermediate changes caused by property change that may potentially @@ -631,8 +631,7 @@ void PropertyItem::setPropertyValue(const QString& value) continue; } - ss << parent->getPropertyPrefix() << prop->getName() << " = " << value.toUtf8().constData() - << '\n'; + ss << parent->getPropertyPrefix() << prop->getName() << " = " << value << '\n'; } std::string cmd = ss.str(); @@ -655,6 +654,11 @@ void PropertyItem::setPropertyValue(const QString& value) } } +void PropertyItem::setPropertyValue(const QString& value) +{ + setPropertyValue(value.toStdString()); +} + QVariant PropertyItem::dataProperty(int role) const { if (role == Qt::ForegroundRole && linked) { diff --git a/src/Gui/propertyeditor/PropertyItem.h b/src/Gui/propertyeditor/PropertyItem.h index 682826232b..04481b3000 100644 --- a/src/Gui/propertyeditor/PropertyItem.h +++ b/src/Gui/propertyeditor/PropertyItem.h @@ -203,6 +203,7 @@ public: protected: PropertyItem(); + void setPropertyValue(const std::string& value); virtual QVariant displayName() const; virtual QVariant decoration(const QVariant&) const; virtual QVariant toolTip(const App::Property*) const;