29 #ifndef ENUM_PROPERTY_H 30 #define ENUM_PROPERTY_H 32 #include <QStringList> 54 const char* changed_slot =
nullptr,
55 QObject* receiver =
nullptr);
61 virtual void addOption(
const QString& option,
int value = 0);
64 addOption(QString::fromStdString(option), value);
71 QWidget*
createEditor(QWidget* parent,
const QStyleOptionViewItem& option)
override;
76 virtual void setString(
const QString& str);
111 #endif // ENUM_PROPERTY_H void setStringStd(const std::string &str)
Set the value of this property to the given std::string. Does not force the value to be one of the li...
void requestOptions(EnumProperty *property_in_need_of_options)
requestOptions() is emitted each time createEditor() is called.
QHash< QString, int > ints_
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option) override
Create an editor widget to edit the value of this property.
A single element of a property tree, with a name, value, description, and possibly children...
virtual void clearOptions()
Clear the list of options.
virtual void addOption(const QString &option, int value=0)
void addOptionStd(const std::string &option, int value=0)
Property specialized for string values.
EnumProperty(const QString &name=QString(), const QString &default_value=QString(), const QString &description=QString(), Property *parent=nullptr, const char *changed_slot=nullptr, QObject *receiver=nullptr)
virtual int getOptionInt()
Return the int value of the currently-chosen option, or 0 if the current option string does not have ...
void sortOptions()
Sort the option strings. Does not change string/int associations.
virtual void setString(const QString &str)
Set the value of this property to the given string. Does not force the value to be one of the list of...