Editable Enum property. More...
#include <editable_enum_property.h>
Public Slots | |
virtual void | setString (const QString &str) |
Signals | |
void | requestOptions (QStringList *option_list_return) |
requestOptions() is emitted each time createEditor() is called. If anything is added to option_list_return after this is emitted, it will be used instead of the options defined by calls to addOption() and clearOptions(). | |
Public Member Functions | |
virtual void | addOption (const QString &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) | |
Private 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::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 | ( | QStringList * | option_list_return | ) | [signal] |
requestOptions() is emitted each time createEditor() is called. If anything is added to option_list_return after this is emitted, it will be used instead of the options defined by calls to addOption() and clearOptions().
A connection to this signal should never be made with a queued connection, because then the "emit" would return before the changes to the list were made.
A connected slot should just add options to "*option_list_return". It will be cleared before this signal is emitted.
void rviz::EditableEnumProperty::setString | ( | const QString & | str | ) | [virtual, slot] |
Definition at line 83 of file editable_enum_property.cpp.
QStringList rviz::EditableEnumProperty::strings_ [private] |
Definition at line 80 of file editable_enum_property.h.