#include <color_property.h>
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_ |
Definition at line 41 of file color_property.h.
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.
QWidget * rviz::ColorProperty::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 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.
painter | The QPainter to use. |
option | A QStyleOptionViewItem with parameters of the paint job, like the rectangle, alignments, etc. |
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.
new_value | The new value to store. |
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.
void rviz::ColorProperty::updateString | ( | ) | [private] |
Definition at line 80 of file color_property.cpp.
QColor rviz::ColorProperty::color_ [private] |
Definition at line 69 of file color_property.h.