Editable Enum property. More...
#include <editable_enum_property.h>
Public Slots | |
virtual void | setString (const QString &str) |
Signals | |
void | requestOptions (EditableEnumProperty *property_in_need_of_options) |
requestOptions() is emitted each time createEditor() is called. | |
Public Member Functions | |
virtual void | addOption (const QString &option) |
void | addOptionStd (const std::string &option) |
virtual void | clearOptions () |
virtual QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option) |
Create an editor widget to edit the value of this property. | |
EditableEnumProperty (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 | sortOptions () |
Sort the option strings. | |
Protected Attributes | |
QStringList | strings_ |
Editable Enum property.
An editable enum property works like a string property, but with the addition of a drop-down list of predefined choices.
Definition at line 44 of file editable_enum_property.h.
rviz::EditableEnumProperty::EditableEnumProperty | ( | const QString & | name = QString() , |
const QString & | default_value = QString() , |
||
const QString & | description = QString() , |
||
Property * | parent = 0 , |
||
const char * | changed_slot = 0 , |
||
QObject * | receiver = 0 |
||
) |
Definition at line 39 of file editable_enum_property.cpp.
void rviz::EditableEnumProperty::addOption | ( | const QString & | option | ) | [virtual] |
Definition at line 54 of file editable_enum_property.cpp.
void rviz::EditableEnumProperty::addOptionStd | ( | const std::string & | option | ) | [inline] |
Definition at line 57 of file editable_enum_property.h.
void rviz::EditableEnumProperty::clearOptions | ( | ) | [virtual] |
Definition at line 49 of file editable_enum_property.cpp.
QWidget * rviz::EditableEnumProperty::createEditor | ( | QWidget * | parent, |
const QStyleOptionViewItem & | option | ||
) | [virtual] |
Create an editor widget to edit the value of this property.
parent | The QWidget to set as the parent of the returned QWidget. |
option | A QStyleOptionViewItem with parameters of the editor widget, like the rectangle, alignments, etc. |
If this function returns NULL, a QStyledItemDelegate will make an editor widget.
The widget returned by createEditor() must have one Q_PROPERTY
with USER
set to true
. The PropertyTreeDelegate finds it, sets it with the results of PropertyTreeModel::data() after creation, and after editing is finished it reads it and calls PropertyTreeModel::setData() with the contents.
Reimplemented from rviz::Property.
Definition at line 59 of file editable_enum_property.cpp.
void rviz::EditableEnumProperty::requestOptions | ( | EditableEnumProperty * | property_in_need_of_options | ) | [signal] |
requestOptions() is emitted each time createEditor() is called.
A connection to this signal should never be made with a queued connection, because then the "emit" would return before the changes to the options in the EnumProperty were made.
A connected slot should make calls to clearOptions() and/or addOption() as needed. The option list in the EditableEnumProperty will not be cleared before the signal is emitted.
void rviz::EditableEnumProperty::setString | ( | const QString & | str | ) | [virtual, slot] |
Reimplemented from rviz::StringProperty.
Definition at line 74 of file editable_enum_property.cpp.
void rviz::EditableEnumProperty::sortOptions | ( | ) | [inline] |
Sort the option strings.
Definition at line 63 of file editable_enum_property.h.
QStringList rviz::EditableEnumProperty::strings_ [protected] |
Definition at line 82 of file editable_enum_property.h.