Public Slots | Public Member Functions | Private Member Functions | Private Attributes
rviz::ColorProperty Class Reference

#include <color_property.h>

Inheritance diagram for rviz::ColorProperty:
Inheritance graph
[legend]

List of all members.

Public Slots

virtual bool setColor (const QColor &color)

Public Member Functions

 ColorProperty (const QString &name=QString(), const QColor &default_value=Qt::black, const QString &description=QString(), Property *parent=0, const char *changed_slot=0, QObject *receiver=0)
virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option)
 Create an editor widget to edit the value of this property.
virtual QColor getColor () const
Ogre::ColourValue getOgreColor () const
virtual bool paint (QPainter *painter, const QStyleOptionViewItem &option) const
 Hook to provide custom painting of the value data (right-hand column) in a subclass.
virtual bool setValue (const QVariant &new_value)
 Set the new value for this property. Returns true if the new value is different from the old value, false if same.

Private Member Functions

void updateString ()

Private Attributes

QColor color_

Detailed Description

Definition at line 41 of file color_property.h.


Constructor & Destructor Documentation

rviz::ColorProperty::ColorProperty ( const QString &  name = QString(),
const QColor &  default_value = Qt::black,
const QString &  description = QString(),
Property parent = 0,
const char *  changed_slot = 0,
QObject *  receiver = 0 
)

Definition at line 41 of file color_property.cpp.


Member Function Documentation

QWidget * rviz::ColorProperty::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option 
) [virtual]

Create an editor widget to edit the value of this property.

Parameters:
parentThe QWidget to set as the parent of the returned QWidget.
optionA QStyleOptionViewItem with parameters of the editor widget, like the rectangle, alignments, etc.
Returns:
the newly-created editor widget. The default implementation creates a QSpinBox for integer values, a FloatEdit for float or double values, or a QLineEdit for anything else.

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 106 of file color_property.cpp.

virtual QColor rviz::ColorProperty::getColor ( ) const [inline, virtual]

Definition at line 60 of file color_property.h.

Ogre::ColourValue rviz::ColorProperty::getOgreColor ( ) const [inline]

Definition at line 61 of file color_property.h.

bool rviz::ColorProperty::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option 
) const [virtual]

Hook to provide custom painting of the value data (right-hand column) in a subclass.

Parameters:
painterThe QPainter to use.
optionA QStyleOptionViewItem with parameters of the paint job, like the rectangle, alignments, etc.
Returns:
true if painting has been done, false if not. The default implementation always returns false.

To implement a custom appearance of a Property value, override this function to do the painting and return true.

If this function returns false, a QStyledItemDelegate will do the painting.

Reimplemented from rviz::Property.

Definition at line 85 of file color_property.cpp.

bool rviz::ColorProperty::setColor ( const QColor &  color) [virtual, slot]

Definition at line 53 of file color_property.cpp.

bool rviz::ColorProperty::setValue ( const QVariant &  new_value) [virtual]

Set the new value for this property. Returns true if the new value is different from the old value, false if same.

Parameters:
new_valueThe new value to store.
Returns:
Returns true if new_value is different from current value, false if they are the same.

If the new value is different from the old value, this emits aboutToChange() before changing the value and emits changed() after.

If the value set is an invalid QVariant (QVariant::isValid() returns false), the value will not be editable in a PropertyTreeWidget.

Reimplemented from rviz::Property.

Definition at line 65 of file color_property.cpp.

Definition at line 80 of file color_property.cpp.


Member Data Documentation

QColor rviz::ColorProperty::color_ [private]

Definition at line 69 of file color_property.h.


The documentation for this class was generated from the following files:


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Tue Oct 3 2017 03:19:31