Signals | Public Member Functions | Private Attributes
rviz::PropertyTreeModel Class Reference

#include <property_tree_model.h>

List of all members.

Signals

void collapse (const QModelIndex &index)
 Emitted when a Property wants to collapse (hide its children).
void configChanged ()
 Emitted when a Property which should be saved changes.
void expand (const QModelIndex &index)
 Emitted when a Property wants to expand (display its children).
void propertyHiddenChanged (const Property *property)
 Emitted when a property within the model is hidden or shown.

Public Member Functions

void beginInsert (Property *parent_property, int row_within_parent, int count=1)
void beginRemove (Property *parent_property, int row_within_parent, int count=1)
void collapseProperty (Property *property)
 Collapse (hide the children of) the given Property.
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
 Return the number of columns under the given parent index, which is always 2 for this model.
virtual QVariant data (const QModelIndex &index, int role) const
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int destination_row, int destination_column, const QModelIndex &destination_parent)
 Override from QAbstractItemModel. Takes a (non-standard) mime-encoded version of an index list and drops it at the destination.
void emitDataChanged (Property *property)
void emitPropertyHiddenChanged (const Property *property)
 Emit the propertyHiddenChanged() signal for the given Property.
void endInsert ()
void endRemove ()
void expandProperty (Property *property)
 Expand (show the children of) the given Property.
virtual Qt::ItemFlags flags (const QModelIndex &index) const
PropertygetProp (const QModelIndex &index) const
 return the Property at the given index, or the root property if the index is invalid.
PropertygetRoot () const
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
virtual QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
QModelIndex indexOf (Property *property) const
virtual QMimeData * mimeData (const QModelIndexList &indexes) const
 Override from QAbstractItemModel. Returns a (non-standard) mime-encoded version of the given indexes.
virtual QStringList mimeTypes () const
 Returns a list with just "application/x-rviz-" plus drag_drop_class_.
virtual QModelIndex parent (const QModelIndex &index) const
QModelIndex parentIndex (const Property *child) const
 Same as parent() but taking a Property pointer instead of an index.
void printPersistentIndices ()
 For debugging only. Uses printf() to print the property names of current persistent indices.
 PropertyTreeModel (Property *root_property, QObject *parent=0)
 Constructor.
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
 Return the number of rows under the given parent index.
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
void setDragDropClass (const QString &drag_drop_class)
virtual Qt::DropActions supportedDropActions () const
virtual ~PropertyTreeModel ()
 Destructor. Deletes the root property (and thus the entire property tree).

Private Attributes

QString drag_drop_class_
 Identifier to add to mimeTypes() entry to keep drag/drops from crossing types.
Propertyroot_property_

Detailed Description

Definition at line 39 of file property_tree_model.h.


Constructor & Destructor Documentation

rviz::PropertyTreeModel::PropertyTreeModel ( Property root_property,
QObject *  parent = 0 
)

Constructor.

Parameters:
root_propertyThe root of the property tree. PropertyTreeModel takes ownership of root_property and deletes it in its destructor.
parentA QObject to set as the parent.

Definition at line 42 of file property_tree_model.cpp.

Destructor. Deletes the root property (and thus the entire property tree).

Definition at line 49 of file property_tree_model.cpp.


Member Function Documentation

void rviz::PropertyTreeModel::beginInsert ( Property parent_property,
int  row_within_parent,
int  count = 1 
)

Definition at line 305 of file property_tree_model.cpp.

void rviz::PropertyTreeModel::beginRemove ( Property parent_property,
int  row_within_parent,
int  count = 1 
)

Definition at line 320 of file property_tree_model.cpp.

void rviz::PropertyTreeModel::collapse ( const QModelIndex &  index) [signal]

Emitted when a Property wants to collapse (hide its children).

Collapse (hide the children of) the given Property.

Definition at line 340 of file property_tree_model.cpp.

virtual int rviz::PropertyTreeModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const [inline, virtual]

Return the number of columns under the given parent index, which is always 2 for this model.

Definition at line 74 of file property_tree_model.h.

Emitted when a Property which should be saved changes.

QVariant rviz::PropertyTreeModel::data ( const QModelIndex &  index,
int  role 
) const [virtual]

Definition at line 125 of file property_tree_model.cpp.

bool rviz::PropertyTreeModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  dest_row,
int  dest_column,
const QModelIndex &  dest_parent 
) [virtual]

Override from QAbstractItemModel. Takes a (non-standard) mime-encoded version of an index list and drops it at the destination.

The model indexes are encoded using pointer values (by mimeData()), which means they will only work within the application this is compiled into.

Definition at line 208 of file property_tree_model.cpp.

Definition at line 294 of file property_tree_model.cpp.

void rviz::PropertyTreeModel::emitPropertyHiddenChanged ( const Property property) [inline]

Emit the propertyHiddenChanged() signal for the given Property.

Definition at line 124 of file property_tree_model.h.

Definition at line 314 of file property_tree_model.cpp.

Definition at line 329 of file property_tree_model.cpp.

void rviz::PropertyTreeModel::expand ( const QModelIndex &  index) [signal]

Emitted when a Property wants to expand (display its children).

Expand (show the children of) the given Property.

Definition at line 335 of file property_tree_model.cpp.

Qt::ItemFlags rviz::PropertyTreeModel::flags ( const QModelIndex &  index) const [virtual]

Definition at line 67 of file property_tree_model.cpp.

Property * rviz::PropertyTreeModel::getProp ( const QModelIndex &  index) const

return the Property at the given index, or the root property if the index is invalid.

Definition at line 54 of file property_tree_model.cpp.

Definition at line 107 of file property_tree_model.h.

QVariant rviz::PropertyTreeModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const [virtual]

Definition at line 135 of file property_tree_model.cpp.

QModelIndex rviz::PropertyTreeModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const [virtual]

Definition at line 77 of file property_tree_model.cpp.

QModelIndex rviz::PropertyTreeModel::indexOf ( Property property) const

Definition at line 285 of file property_tree_model.cpp.

QMimeData * rviz::PropertyTreeModel::mimeData ( const QModelIndexList &  indexes) const [virtual]

Override from QAbstractItemModel. Returns a (non-standard) mime-encoded version of the given indexes.

Returns the model indexes encoded using pointer values, which means they will only work within the application this is compiled into.

Definition at line 171 of file property_tree_model.cpp.

QStringList rviz::PropertyTreeModel::mimeTypes ( ) const [virtual]

Returns a list with just "application/x-rviz-" plus drag_drop_class_.

Definition at line 278 of file property_tree_model.cpp.

QModelIndex rviz::PropertyTreeModel::parent ( const QModelIndex &  index) const [virtual]

Definition at line 96 of file property_tree_model.cpp.

QModelIndex rviz::PropertyTreeModel::parentIndex ( const Property child) const

Same as parent() but taking a Property pointer instead of an index.

Definition at line 106 of file property_tree_model.cpp.

For debugging only. Uses printf() to print the property names of current persistent indices.

Definition at line 345 of file property_tree_model.cpp.

void rviz::PropertyTreeModel::propertyHiddenChanged ( const Property property) [signal]

Emitted when a property within the model is hidden or shown.

int rviz::PropertyTreeModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const [virtual]

Return the number of rows under the given parent index.

Definition at line 120 of file property_tree_model.cpp.

bool rviz::PropertyTreeModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
) [virtual]

Definition at line 141 of file property_tree_model.cpp.

void rviz::PropertyTreeModel::setDragDropClass ( const QString &  drag_drop_class) [inline]

Definition at line 54 of file property_tree_model.h.

virtual Qt::DropActions rviz::PropertyTreeModel::supportedDropActions ( ) const [inline, virtual]

Definition at line 81 of file property_tree_model.h.


Member Data Documentation

Identifier to add to mimeTypes() entry to keep drag/drops from crossing types.

Definition at line 151 of file property_tree_model.h.

Definition at line 150 of file property_tree_model.h.


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


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Thu Jun 6 2019 18:02:17