mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
LP-567 added comments and const correctness
This commit is contained in:
parent
64dfc358f8
commit
96cf07e77d
@ -238,6 +238,8 @@ DataObjectTreeItem *UAVObjectTreeModel::createDataObject(UAVDataObject *obj)
|
||||
addObjectTreeItem(obj->getObjID(), item);
|
||||
item->setHighlightManager(m_highlightManager);
|
||||
|
||||
// metadata items are created up front and are added/removed as needed
|
||||
// see toggleMetaItems()
|
||||
MetaObjectTreeItem *metaItem = createMetaObject(obj->getMetaObject());
|
||||
if (showMetadata()) {
|
||||
appendItem(item, metaItem);
|
||||
@ -303,6 +305,8 @@ TreeItem *UAVObjectTreeModel::getParentItem(UAVDataObject *obj, bool categorize)
|
||||
QStringList categoryPath = category.split('/');
|
||||
|
||||
foreach(QString category, categoryPath) {
|
||||
// metadata items are created and destroyed as needed
|
||||
// see toggleCategoryItems()
|
||||
TreeItem *categoryItem = parentItem->childByName(category);
|
||||
|
||||
if (!categoryItem) {
|
||||
@ -486,7 +490,7 @@ QModelIndex UAVObjectTreeModel::index(int row, int column, const QModelIndex &pa
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
QModelIndex UAVObjectTreeModel::index(TreeItem *item, int column)
|
||||
QModelIndex UAVObjectTreeModel::index(TreeItem *item, int column) const
|
||||
{
|
||||
if (item == m_rootItem) {
|
||||
return QModelIndex();
|
||||
|
@ -109,7 +109,7 @@ private:
|
||||
|
||||
QHash<quint32, ObjectTreeItem *> m_objectTreeItems;
|
||||
|
||||
QModelIndex index(TreeItem *item, int column = 0);
|
||||
QModelIndex index(TreeItem *item, int column = 0) const;
|
||||
|
||||
void setupModelData();
|
||||
void resetModelData();
|
||||
|
Loading…
Reference in New Issue
Block a user