Signals | Public Member Functions | Private Attributes | List of all members
rviz::PropertyTreeModel Class Reference

#include <property_tree_model.h>

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

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...
 
int columnCount (const QModelIndex &=QModelIndex()) const override
 Return the number of columns under the given parent index, which is always 2 for this model. More...
 
QVariant data (const QModelIndex &index, int role) const override
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int destination_row, int destination_column, const QModelIndex &destination_parent) override
 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...
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
PropertygetProp (const QModelIndex &index) const
 return the Property at the given index, or the root property if the index is invalid. More...
 
PropertygetRoot () const
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex indexOf (Property *property) const
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 Override from QAbstractItemModel. Returns a (non-standard) mime-encoded version of the given indexes. More...
 
QStringList mimeTypes () const override
 Returns a list with just "application/x-rviz-" plus drag_drop_class_. More...
 
QModelIndex parent (const QModelIndex &index) const override
 
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=nullptr)
 Constructor. More...
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Return the number of rows under the given parent index. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
void setDragDropClass (const QString &drag_drop_class)
 
Qt::DropActions supportedDropActions () const override
 
 ~PropertyTreeModel () override
 Destructor. Deletes the root property (and thus the entire property tree). More...
 

Private Attributes

QString drag_drop_class_
 
Propertyroot_property_
 

Detailed Description

Definition at line 38 of file property_tree_model.h.

Constructor & Destructor Documentation

◆ PropertyTreeModel()

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

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 41 of file property_tree_model.cpp.

◆ ~PropertyTreeModel()

rviz::PropertyTreeModel::~PropertyTreeModel ( )
override

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

Definition at line 47 of file property_tree_model.cpp.

Member Function Documentation

◆ beginInsert()

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

Definition at line 301 of file property_tree_model.cpp.

◆ beginRemove()

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

Definition at line 316 of file property_tree_model.cpp.

◆ collapse

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

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

◆ collapseProperty()

void rviz::PropertyTreeModel::collapseProperty ( Property property)

Collapse (hide the children of) the given Property.

Definition at line 336 of file property_tree_model.cpp.

◆ columnCount()

int rviz::PropertyTreeModel::columnCount ( const QModelIndex &  = QModelIndex()) const
inlineoverride

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

Definition at line 75 of file property_tree_model.h.

◆ configChanged

void rviz::PropertyTreeModel::configChanged ( )
signal

Emitted when a Property which should be saved changes.

◆ data()

QVariant rviz::PropertyTreeModel::data ( const QModelIndex &  index,
int  role 
) const
override

Definition at line 123 of file property_tree_model.cpp.

◆ dropMimeData()

bool rviz::PropertyTreeModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  dest_row,
int  destination_column,
const QModelIndex &  dest_parent 
)
override

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 203 of file property_tree_model.cpp.

◆ emitDataChanged()

void rviz::PropertyTreeModel::emitDataChanged ( Property property)

Definition at line 290 of file property_tree_model.cpp.

◆ emitPropertyHiddenChanged()

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

Emit the propertyHiddenChanged() signal for the given Property.

Definition at line 134 of file property_tree_model.h.

◆ endInsert()

void rviz::PropertyTreeModel::endInsert ( )

Definition at line 310 of file property_tree_model.cpp.

◆ endRemove()

void rviz::PropertyTreeModel::endRemove ( )

Definition at line 325 of file property_tree_model.cpp.

◆ expand

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

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

◆ expandProperty()

void rviz::PropertyTreeModel::expandProperty ( Property property)

Expand (show the children of) the given Property.

Definition at line 331 of file property_tree_model.cpp.

◆ flags()

Qt::ItemFlags rviz::PropertyTreeModel::flags ( const QModelIndex &  index) const
override

Definition at line 65 of file property_tree_model.cpp.

◆ getProp()

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 52 of file property_tree_model.cpp.

◆ getRoot()

Property* rviz::PropertyTreeModel::getRoot ( ) const
inline

Definition at line 114 of file property_tree_model.h.

◆ headerData()

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

Definition at line 134 of file property_tree_model.cpp.

◆ index()

QModelIndex rviz::PropertyTreeModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

Definition at line 75 of file property_tree_model.cpp.

◆ indexOf()

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

Definition at line 281 of file property_tree_model.cpp.

◆ mimeData()

QMimeData * rviz::PropertyTreeModel::mimeData ( const QModelIndexList &  indexes) const
override

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 166 of file property_tree_model.cpp.

◆ mimeTypes()

QStringList rviz::PropertyTreeModel::mimeTypes ( ) const
override

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

Definition at line 274 of file property_tree_model.cpp.

◆ parent()

QModelIndex rviz::PropertyTreeModel::parent ( const QModelIndex &  index) const
override

Definition at line 94 of file property_tree_model.cpp.

◆ parentIndex()

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

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

Definition at line 104 of file property_tree_model.cpp.

◆ printPersistentIndices()

void rviz::PropertyTreeModel::printPersistentIndices ( )

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

Definition at line 341 of file property_tree_model.cpp.

◆ propertyHiddenChanged

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

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

◆ rowCount()

int rviz::PropertyTreeModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Return the number of rows under the given parent index.

Definition at line 118 of file property_tree_model.cpp.

◆ setData()

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

Definition at line 140 of file property_tree_model.cpp.

◆ setDragDropClass()

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

Definition at line 53 of file property_tree_model.h.

◆ supportedDropActions()

Qt::DropActions rviz::PropertyTreeModel::supportedDropActions ( ) const
inlineoverride

Definition at line 84 of file property_tree_model.h.

Member Data Documentation

◆ drag_drop_class_

QString rviz::PropertyTreeModel::drag_drop_class_
private

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

Definition at line 164 of file property_tree_model.h.

◆ root_property_

Property* rviz::PropertyTreeModel::root_property_
private

Definition at line 163 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 Sat May 27 2023 02:06:26