#include <property_widget_item.h>
Public Member Functions | |
void | addToParent (PropertyWidgetItem *parent_item=0) |
virtual QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option) |
PropertyBase * | getProperty () |
virtual bool | paint (QPainter *painter, const QStyleOptionViewItem &option) |
PropertyWidgetItem (PropertyBase *property, const std::string &label, bool editable=true, bool needs_check_box=false, bool first_column_spans=false) | |
virtual bool | setEditorData (QWidget *editor) |
void | setLeftText (const std::string &text) |
virtual bool | setModelData (QWidget *editor) |
void | setRightText (const std::string &text) |
void | setRightText (const QString &text) |
void | setUserData (QVariant data) |
QVariant | userData () const |
Public Attributes | |
double | max_ |
double | min_ |
Private Attributes | |
bool | first_column_spans_ |
PropertyBase * | property_ |
Definition at line 42 of file property_widget_item.h.
rviz::PropertyWidgetItem::PropertyWidgetItem | ( | PropertyBase * | property, |
const std::string & | label, | ||
bool | editable = true , |
||
bool | needs_check_box = false , |
||
bool | first_column_spans = false |
||
) |
Definition at line 40 of file property_widget_item.cpp.
void rviz::PropertyWidgetItem::addToParent | ( | PropertyWidgetItem * | parent_item = 0 | ) |
Add this item to a parent. If parent_item is given, this item will be a child of that. If parent_item is not given, it will be added either to the top level of the tree or to the parent category, according to information from the PropertyBase.
Definition at line 74 of file property_widget_item.cpp.
virtual QWidget* rviz::PropertyWidgetItem::createEditor | ( | QWidget * | parent, |
const QStyleOptionViewItem & | option | ||
) | [inline, 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 in rviz::EditEnumItem, rviz::EnumItem, and rviz::ColorItem.
Definition at line 90 of file property_widget_item.h.
PropertyBase* rviz::PropertyWidgetItem::getProperty | ( | ) | [inline] |
Definition at line 57 of file property_widget_item.h.
virtual bool rviz::PropertyWidgetItem::paint | ( | QPainter * | painter, |
const QStyleOptionViewItem & | option | ||
) | [inline, virtual] |
Do custom painting of the widget item here, and return true; or return false to let the QStyledItemDelegate do the painting.
Reimplemented in rviz::ColorItem.
Definition at line 81 of file property_widget_item.h.
virtual bool rviz::PropertyWidgetItem::setEditorData | ( | QWidget * | editor | ) | [inline, 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 in rviz::EditEnumItem, rviz::EnumItem, and rviz::ColorItem.
Definition at line 99 of file property_widget_item.h.
void rviz::PropertyWidgetItem::setLeftText | ( | const std::string & | text | ) |
Set the display text for the left column of this item without triggering the data-changed signal.
Definition at line 98 of file property_widget_item.cpp.
virtual bool rviz::PropertyWidgetItem::setModelData | ( | QWidget * | editor | ) | [inline, 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 in rviz::EditEnumItem, rviz::CompoundWidgetItem, rviz::EnumItem, and rviz::ColorItem.
Definition at line 107 of file property_widget_item.h.
void rviz::PropertyWidgetItem::setRightText | ( | const std::string & | text | ) |
Set the display text for the right column of this item without triggering the data-changed signal.
Definition at line 116 of file property_widget_item.cpp.
void rviz::PropertyWidgetItem::setRightText | ( | const QString & | text | ) |
Set the display text for the right column of this item without triggering the data-changed signal.
Definition at line 107 of file property_widget_item.cpp.
void rviz::PropertyWidgetItem::setUserData | ( | QVariant | data | ) |
Set cargo data, which goes into the Qt::UserRole of the right column, as well as a string-ified version into the text of the right column.
Definition at line 121 of file property_widget_item.cpp.
QVariant rviz::PropertyWidgetItem::userData | ( | ) | const |
Return the Qt::UserRole data of the right column.
Definition at line 140 of file property_widget_item.cpp.
Definition at line 117 of file property_widget_item.h.
Definition at line 112 of file property_widget_item.h.
Definition at line 113 of file property_widget_item.h.
PropertyBase* rviz::PropertyWidgetItem::property_ [private] |
Definition at line 116 of file property_widget_item.h.