#include <property_tree_model.h>
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 |
Property * | getProp (const QModelIndex &index) const |
return the Property at the given index, or the root property if the index is invalid. | |
Property * | getRoot () 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-rvizpropertyitemmodeldatalist". | |
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) |
virtual Qt::DropActions | supportedDropActions () const |
virtual | ~PropertyTreeModel () |
Destructor. Deletes the root property (and thus the entire property tree). | |
Private Attributes | |
Property * | root_property_ |
Definition at line 39 of file property_tree_model.h.
rviz::PropertyTreeModel::PropertyTreeModel | ( | Property * | root_property, | |
QObject * | parent = 0 | |||
) |
Constructor.
root_property | The root of the property tree. PropertyTreeModel takes ownership of root_property and deletes it in its destructor. | |
parent | A QObject to set as the parent. |
Definition at line 42 of file property_tree_model.cpp.
rviz::PropertyTreeModel::~PropertyTreeModel | ( | ) | [virtual] |
Destructor. Deletes the root property (and thus the entire property tree).
Definition at line 49 of file property_tree_model.cpp.
void rviz::PropertyTreeModel::beginInsert | ( | Property * | parent_property, | |
int | row_within_parent, | |||
int | count = 1 | |||
) |
Definition at line 307 of file property_tree_model.cpp.
void rviz::PropertyTreeModel::beginRemove | ( | Property * | parent_property, | |
int | row_within_parent, | |||
int | count = 1 | |||
) |
Definition at line 322 of file property_tree_model.cpp.
void rviz::PropertyTreeModel::collapse | ( | const QModelIndex & | index | ) | [signal] |
Emitted when a Property wants to collapse (hide its children).
void rviz::PropertyTreeModel::collapseProperty | ( | Property * | property | ) |
Collapse (hide the children of) the given Property.
Definition at line 342 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 72 of file property_tree_model.h.
void rviz::PropertyTreeModel::configChanged | ( | ) | [signal] |
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.
void rviz::PropertyTreeModel::emitDataChanged | ( | Property * | property | ) |
Definition at line 296 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 122 of file property_tree_model.h.
void rviz::PropertyTreeModel::endInsert | ( | ) |
Definition at line 316 of file property_tree_model.cpp.
void rviz::PropertyTreeModel::endRemove | ( | ) |
Definition at line 331 of file property_tree_model.cpp.
void rviz::PropertyTreeModel::expand | ( | const QModelIndex & | index | ) | [signal] |
Emitted when a Property wants to expand (display its children).
void rviz::PropertyTreeModel::expandProperty | ( | Property * | property | ) |
Expand (show the children of) the given Property.
Definition at line 337 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.
Property* rviz::PropertyTreeModel::getRoot | ( | ) | const [inline] |
Definition at line 105 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 287 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-rvizpropertyitemmodeldatalist".
Definition at line 280 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.
void rviz::PropertyTreeModel::printPersistentIndices | ( | ) |
For debugging only. Uses printf() to print the property names of current persistent indices.
Definition at line 347 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.
virtual Qt::DropActions rviz::PropertyTreeModel::supportedDropActions | ( | ) | const [inline, virtual] |
Definition at line 79 of file property_tree_model.h.
Property* rviz::PropertyTreeModel::root_property_ [private] |
Definition at line 148 of file property_tree_model.h.