#include <enum_item.h>
Public Member Functions | |
virtual QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option) |
EnumItem (EnumProperty *property) | |
int | getChoiceValue () |
void | setChoices (Choices choices) |
void | setChoiceValue (int choice_value) |
virtual bool | setEditorData (QWidget *editor) |
virtual bool | setModelData (QWidget *editor) |
Private Slots | |
void | setChoiceIndex (int new_choice_index) |
Private Member Functions | |
std::string | currentChoiceName () |
Private Attributes | |
int | choice_value_ |
Choices | choices_ |
bool | signal_changes_ |
Definition at line 40 of file enum_item.h.
rviz::EnumItem::EnumItem | ( | EnumProperty * | property | ) |
Definition at line 41 of file enum_item.cpp.
QWidget * rviz::EnumItem::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 enum_item.cpp.
std::string rviz::EnumItem::currentChoiceName | ( | ) | [private] |
Definition at line 103 of file enum_item.cpp.
int rviz::EnumItem::getChoiceValue | ( | ) | [inline] |
Definition at line 62 of file enum_item.h.
void rviz::EnumItem::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 90 of file enum_item.cpp.
void rviz::EnumItem::setChoices | ( | Choices | choices | ) |
Set the list of choice names and values.
Definition at line 115 of file enum_item.cpp.
void rviz::EnumItem::setChoiceValue | ( | int | choice_value | ) |
Set the value of the current choice. This finds the corresponding choice name and makes it show up in the tree.
Definition at line 124 of file enum_item.cpp.
bool rviz::EnumItem::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 56 of file enum_item.cpp.
bool rviz::EnumItem::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 80 of file enum_item.cpp.
int rviz::EnumItem::choice_value_ [private] |
Definition at line 73 of file enum_item.h.
Choices rviz::EnumItem::choices_ [private] |
Definition at line 72 of file enum_item.h.
bool rviz::EnumItem::signal_changes_ [private] |
Definition at line 74 of file enum_item.h.