Gui: propertyeditor: add setPropertyValue with std::string argument

This commit is contained in:
Ladislav Michl
2024-11-02 19:44:00 +01:00
committed by wwmayer
parent fc30ac6fbd
commit 00ce52c432
2 changed files with 8 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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;