29 #ifndef ENUM_PROPERTY_H 30 #define ENUM_PROPERTY_H 32 #include <QStringList> 55 const char *changed_slot = 0,
56 QObject* receiver = 0 );
62 virtual void addOption(
const QString& option,
int value = 0 );
63 void addOptionStd(
const std::string& option,
int value = 0 ) {
addOption( QString::fromStdString( option ), value ); }
70 const QStyleOptionViewItem& option );
75 virtual void setString(
const QString& str );
104 #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_
A single element of a property tree, with a name, value, description, and possibly children...
virtual void clearOptions()
Clear the list of options.
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option)
Create an editor widget to edit the value of this property.
virtual void addOption(const QString &option, int value=0)
EnumProperty(const QString &name=QString(), const QString &default_value=QString(), const QString &description=QString(), Property *parent=0, const char *changed_slot=0, QObject *receiver=0)
void addOptionStd(const std::string &option, int value=0)
Property specialized for string values.
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...