10#ifndef VIEWER_MODELPARTLIST_H
11#define VIEWER_MODELPARTLIST_H
16#include <QAbstractItemModel>
60 QVariant
data(
const QModelIndex&
index,
int role )
const;
67 Qt::ItemFlags
flags(
const QModelIndex&
index )
const;
77 QVariant
headerData(
int section, Qt::Orientation orientation,
int role )
const;
87 QModelIndex
index(
int row,
int column,
const QModelIndex&
parent )
const;
95 QModelIndex
parent(
const QModelIndex&
index )
const;
126 bool removeRows(
int row,
int count,
const QModelIndex&
parent = QModelIndex())
override;
Defines the ModelPart class used to represent CAD model parts in the tree view and VTK renderer.
Model class used by Qt to display ModelPart objects in a tree view.
Definition ModelPartList.h:30
int rowCount(const QModelIndex &parent) const
Returns number of child rows under a parent.
Definition ModelPartList.cpp:110
ModelPart * getRootItem()
Returns pointer to root item.
Definition ModelPartList.cpp:124
QModelIndex parent(const QModelIndex &index) const
Returns parent index of a given item.
Definition ModelPartList.cpp:96
int columnCount(const QModelIndex &parent) const
Returns number of columns in the model.
Definition ModelPartList.cpp:27
QModelIndex index(int row, int column, const QModelIndex &parent) const
Creates an index for a given row and column.
Definition ModelPartList.cpp:79
QVariant data(const QModelIndex &index, int role) const
Returns data for a given index and role.
Definition ModelPartList.cpp:34
QVariant headerData(int section, Qt::Orientation orientation, int role) const
Returns header data for the model.
Definition ModelPartList.cpp:71
~ModelPartList()
Destructor.
Definition ModelPartList.cpp:22
Qt::ItemFlags flags(const QModelIndex &index) const
Returns flags for an item.
Definition ModelPartList.cpp:63
QModelIndex appendChild(QModelIndex &parent, const QList< QVariant > &data)
Adds a child item to the tree.
Definition ModelPartList.cpp:130
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
Removes rows from the model.
Definition ModelPartList.cpp:161
Represents one CAD model part in the application.
Definition ModelPart.h:30