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

Property specialized to provide max/min enforcement for integers. More...

#include <int_property.h>

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

List of all members.

Public Slots

void setInt (int new_value)
 Set the value of this property to the given integer.

Public Member Functions

virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option)
 Overridden to create a QSpinBox with the min and max set and with a signal/slot connection to setInt(), so the Property value updates every time the value changes, not just when "return" is pressed.
virtual int getInt () const
 Return the internal property value as an integer.
int getMax ()
int getMin ()
 IntProperty (const QString &name=QString(), int default_value=0, const QString &description=QString(), Property *parent=0, const char *changed_slot=0, QObject *receiver=0)
 Constructor.
void setMax (int max)
void setMin (int min)
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 Attributes

int max_
int min_

Detailed Description

Property specialized to provide max/min enforcement for integers.

Definition at line 38 of file int_property.h.


Constructor & Destructor Documentation

rviz::IntProperty::IntProperty ( const QString &  name = QString(),
int  default_value = 0,
const QString &  description = QString(),
Property parent = 0,
const char *  changed_slot = 0,
QObject *  receiver = 0 
)

Constructor.

Parameters:
nameThe name of this property. Appears in the left column of a PropertyTreeWidget.
default_valueThe initial value to store in the property. Appears in the right column of a PropertyTreeWidget.
descriptionText describing the property. Is shown in the "help" area of a PropertyTreeWithHelp widget.
parentThe parent Property, or NULL if there is no parent at this time.
changed_slotThis should be a Qt slot specification, generated by Qt's SLOT() macro. It should be a slot on the receiver object, or if receiver is not specified, it should be a slot on the parent.
receiverIf receiver is non-NULL, the changed() signal is connected to the changed_slot on the receiver object.

Definition at line 40 of file int_property.cpp.


Member Function Documentation

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

Overridden to create a QSpinBox with the min and max set and with a signal/slot connection to setInt(), so the Property value updates every time the value changes, not just when "return" is pressed.

Reimplemented from rviz::Property.

Definition at line 69 of file int_property.cpp.

virtual int rviz::IntProperty::getInt ( ) const [inline, virtual]

Return the internal property value as an integer.

If a non-integer value was stored in this property, this will return 0.

Definition at line 73 of file int_property.h.

int rviz::IntProperty::getMax ( ) [inline]

Definition at line 78 of file int_property.h.

int rviz::IntProperty::getMin ( ) [inline]

Definition at line 76 of file int_property.h.

void rviz::IntProperty::setInt ( int  new_value) [inline, slot]

Set the value of this property to the given integer.

This just calls setValue(), which is where the min/max are enforced.

Definition at line 91 of file int_property.h.

void rviz::IntProperty::setMax ( int  max)

Definition at line 63 of file int_property.cpp.

void rviz::IntProperty::setMin ( int  min)

Definition at line 57 of file int_property.cpp.

bool rviz::IntProperty::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.

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

Overridden from Property::setValue() to enforce minimum and maximum.

Reimplemented from rviz::Property.

Definition at line 52 of file int_property.cpp.


Member Data Documentation

int rviz::IntProperty::max_ [private]

Definition at line 95 of file int_property.h.

int rviz::IntProperty::min_ [private]

Definition at line 94 of file int_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:32