Go to the documentation of this file.
29 #ifndef ENUM_PROPERTY_H
30 #define ENUM_PROPERTY_H
32 #include <QStringList>
55 template <
typename Func,
typename R>
57 const QString& default_value,
58 const QString& description,
64 connect(receiver, std::forward<Func>(changed_slot));
68 template <
typename Func,
typename P>
70 const QString& default_value,
71 const QString& description,
76 connect(parent, std::forward<Func>(changed_slot));
83 virtual void addOption(
const QString& option,
int value = 0);
86 addOption(QString::fromStdString(option), value);
93 QWidget*
createEditor(QWidget* parent,
const QStyleOptionViewItem& option)
override;
98 virtual void setString(
const QString& str);
133 #endif // ENUM_PROPERTY_H
virtual int getOptionInt()
Return the int value of the currently-chosen option, or 0 if the current option string does not have ...
virtual void clearOptions()
Clear the list of options.
EnumProperty(const QString &name, const QString &default_value, const QString &description, P *parent, Func &&changed_slot)
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...
EnumProperty(const QString &name=QString(), const QString &default_value=QString(), const QString &description=QString(), Property *parent=nullptr)
void requestOptions(EnumProperty *property_in_need_of_options)
requestOptions() is emitted each time createEditor() is called.
QMetaObject::Connection connect(const QObject *receiver, const char *slot, Qt::ConnectionType type=Qt::AutoConnection)
Connect changed() signal to given slot of receiver.
A single element of a property tree, with a name, value, description, and possibly children.
virtual void addOption(const QString &option, int value=0)
Property specialized for string values.
void addOptionStd(const std::string &option, int value=0)
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...
EnumProperty(const QString &name, const QString &default_value, const QString &description, Property *parent, Func &&changed_slot, const R *receiver)
QHash< QString, int > ints_
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option) override
Create an editor widget to edit the value of this property.
rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Dec 13 2024 03:31:02