29 #ifndef STRING_PROPERTY_H 30 #define STRING_PROPERTY_H 47 const char* changed_slot =
nullptr,
48 QObject* receiver =
nullptr);
52 return getValue().toString().toStdString();
66 return setValue(QString::fromStdString(std_str));
72 #endif // STRING_PROPERTY_H virtual bool setValue(const QVariant &new_value)
Set the new value for this property. Returns true if the new value is different from the old value...
A single element of a property tree, with a name, value, description, and possibly children...
bool setString(const QString &str)
std::string getStdString()
StringProperty(const QString &name=QString(), const QString &default_value=QString(), const QString &description=QString(), Property *parent=nullptr, const char *changed_slot=nullptr, QObject *receiver=nullptr)
Property specialized for string values.
virtual QVariant getValue() const
Return the value of this Property as a QVariant. If the value has never been set, an invalid QVariant...
bool setStdString(const std::string &std_str)