#include <edit_enum_item.h>
Public Member Functions | |
virtual QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option) |
EditEnumItem (EditEnumProperty *property) | |
std::string | getChoice () |
void | setChoice (const std::string &choice) |
void | setChoices (V_string &choices) |
virtual bool | setEditorData (QWidget *editor) |
virtual bool | setModelData (QWidget *editor) |
void | setOptionCallback (EditEnumOptionCallback cb) |
Private Slots | |
void | setChoiceIndex (int new_choice_index) |
Private Attributes | |
std::string | choice_ |
V_string | choices_ |
EditEnumOptionCallback | option_cb_ |
bool | signal_changes_ |
Definition at line 43 of file edit_enum_item.h.
rviz::EditEnumItem::EditEnumItem | ( | EditEnumProperty * | property | ) |
Definition at line 42 of file edit_enum_item.cpp.
QWidget * rviz::EditEnumItem::createEditor | ( | QWidget * | parent, |
const QStyleOptionViewItem & | option | ||
) | [virtual] |
Override to create a custom editor widget for this item. The base implementation returns NULL, which will case the default QLineEdit to be created.
Reimplemented from rviz::PropertyWidgetItem.
Definition at line 48 of file edit_enum_item.cpp.
std::string rviz::EditEnumItem::getChoice | ( | ) | [inline] |
Definition at line 64 of file edit_enum_item.h.
void rviz::EditEnumItem::setChoice | ( | const std::string & | choice | ) |
Set the current choice.
Definition at line 109 of file edit_enum_item.cpp.
void rviz::EditEnumItem::setChoiceIndex | ( | int | new_choice_index | ) | [private, slot] |
Set a new choice by index into choices_. Called from user GUI events, so emits data-changed signal.
Definition at line 129 of file edit_enum_item.cpp.
void rviz::EditEnumItem::setChoices | ( | V_string & | choices | ) |
Set the list of choice names and values.
Definition at line 118 of file edit_enum_item.cpp.
bool rviz::EditEnumItem::setEditorData | ( | QWidget * | editor | ) | [virtual] |
Override to load an editor with data from the model. Return true to claim to have done the work, false to fall back on the default behavior.
Reimplemented from rviz::PropertyWidgetItem.
Definition at line 57 of file edit_enum_item.cpp.
bool rviz::EditEnumItem::setModelData | ( | QWidget * | editor | ) | [virtual] |
Override to read data from an editor and store it in the model. Return true to claim to have done the work, false to fall back on the default behavior.
Reimplemented from rviz::PropertyWidgetItem.
Definition at line 93 of file edit_enum_item.cpp.
void rviz::EditEnumItem::setOptionCallback | ( | EditEnumOptionCallback | cb | ) | [inline] |
Definition at line 66 of file edit_enum_item.h.
std::string rviz::EditEnumItem::choice_ [private] |
Definition at line 75 of file edit_enum_item.h.
V_string rviz::EditEnumItem::choices_ [private] |
Definition at line 74 of file edit_enum_item.h.
Function to call to get option list, called each time option list is shown.
Definition at line 80 of file edit_enum_item.h.
bool rviz::EditEnumItem::signal_changes_ [private] |
Definition at line 76 of file edit_enum_item.h.