#include <property_tree_model.h>
Signals | |
void | collapse (const QModelIndex &index) |
Emitted when a Property wants to collapse (hide its children). More... | |
void | configChanged () |
Emitted when a Property which should be saved changes. More... | |
void | expand (const QModelIndex &index) |
Emitted when a Property wants to expand (display its children). More... | |
void | propertyHiddenChanged (const Property *property) |
Emitted when a property within the model is hidden or shown. More... | |
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. More... | |
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. More... | |
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. More... | |
void | emitDataChanged (Property *property) |
void | emitPropertyHiddenChanged (const Property *property) |
Emit the propertyHiddenChanged() signal for the given Property. More... | |
void | endInsert () |
void | endRemove () |
void | expandProperty (Property *property) |
Expand (show the children of) the given Property. More... | |
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. More... | |
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. More... | |
virtual QStringList | mimeTypes () const |
Returns a list with just "application/x-rviz-" plus drag_drop_class_. More... | |
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. More... | |
void | printPersistentIndices () |
For debugging only. Uses printf() to print the property names of current persistent indices. More... | |
PropertyTreeModel (Property *root_property, QObject *parent=0) | |
Constructor. More... | |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
Return the number of rows under the given parent index. More... | |
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). More... | |
Private Attributes | |
QString | drag_drop_class_ |
Identifier to add to mimeTypes() entry to keep drag/drops from crossing types. More... | |
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.
|
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 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.
|
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 340 of file property_tree_model.cpp.
|
inlinevirtual |
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.
|
signal |
Emitted when a Property which should be saved changes.
|
virtual |
Definition at line 125 of file property_tree_model.cpp.
|
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 294 of file property_tree_model.cpp.
|
inline |
Emit the propertyHiddenChanged() signal for the given Property.
Definition at line 124 of file property_tree_model.h.
void rviz::PropertyTreeModel::endInsert | ( | ) |
Definition at line 314 of file property_tree_model.cpp.
void rviz::PropertyTreeModel::endRemove | ( | ) |
Definition at line 329 of file property_tree_model.cpp.
|
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 335 of file property_tree_model.cpp.
|
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.
|
inline |
Definition at line 107 of file property_tree_model.h.
|
virtual |
Definition at line 135 of file property_tree_model.cpp.
|
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.
|
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.
|
virtual |
Returns a list with just "application/x-rviz-" plus drag_drop_class_.
Definition at line 278 of file property_tree_model.cpp.
|
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 345 of file property_tree_model.cpp.
|
signal |
Emitted when a property within the model is hidden or shown.
|
virtual |
Return the number of rows under the given parent index.
Definition at line 120 of file property_tree_model.cpp.
|
virtual |
Definition at line 141 of file property_tree_model.cpp.
|
inline |
Definition at line 54 of file property_tree_model.h.
|
inlinevirtual |
Definition at line 81 of file property_tree_model.h.
|
private |
Identifier to add to mimeTypes() entry to keep drag/drops from crossing types.
Definition at line 151 of file property_tree_model.h.
|
private |
Definition at line 150 of file property_tree_model.h.