#include <jobpropertymodel.h>
Public Member Functions | |
JobPropertyModel (QObject *parent) | |
~JobPropertyModel () | |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
QModelIndex | parent (const QModelIndex &index) const |
int | rowCount (const QModelIndex &parent=QModelIndex()) const |
int | columnCount (const QModelIndex &parent=QModelIndex()) const |
Qt::ItemFlags | flags (const QModelIndex &index) const |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
bool | setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole) |
void | emitLayoutAboutToBeChanged () |
void | emitLayoutChanged () |
JobPropertyItem * | getItem (const QModelIndex &index) const |
Public Attributes | |
JobPropertyItem * | rootItem |
bool | _layoutAboutToBeChanged |
Definition at line 19 of file jobpropertymodel.h.
JobPropertyModel::JobPropertyModel | ( | QObject * | parent | ) |
Construct a JobPropertyModel
parent | parent of this model |
Definition at line 18 of file jobpropertymodel.cpp.
References data(), and rootItem.
JobPropertyModel::~JobPropertyModel | ( | ) |
QVariant JobPropertyModel::data | ( | const QModelIndex & | index, | |
int | role = Qt::DisplayRole | |||
) | const |
Get the data at the specified index for the specified role
index | where to get the data | |
role | role how to view the data |
Definition at line 51 of file jobpropertymodel.cpp.
References JobPropertyItem::data(), and getItem().
Referenced by JobPropertyModel().
QVariant JobPropertyModel::headerData | ( | int | section, | |
Qt::Orientation | orientation, | |||
int | role = Qt::DisplayRole | |||
) | const |
Get the Header data for the specified section.
section | section to get the header | |
orientation | orientation | |
role | role to view the header |
Definition at line 96 of file jobpropertymodel.cpp.
References JobPropertyItem::data(), and rootItem.
QModelIndex JobPropertyModel::index | ( | int | row, | |
int | column, | |||
const QModelIndex & | parent = QModelIndex() | |||
) | const |
Get an index to the specified position
row | row index | |
column | column index | |
parent | parent of the item to get an index for |
Definition at line 112 of file jobpropertymodel.cpp.
References JobPropertyItem::child(), and getItem().
Referenced by JobPropertyItem::getSelfIndex().
bool JobPropertyModel::removeRows | ( | int | row, | |
int | count, | |||
const QModelIndex & | parent = QModelIndex() | |||
) |
Remove rows in the model
row | index of the first row to remove in the child list of the parent | |
count | number of rows to delete | |
parent | parent of the rows to remove |
Definition at line 224 of file jobpropertymodel.cpp.
References JobPropertyItem::deleteChild(), and getItem().
QModelIndex JobPropertyModel::parent | ( | const QModelIndex & | index | ) | const |
Get the parent of the specified item
index | indes to the item to get the parent of |
Definition at line 131 of file jobpropertymodel.cpp.
References JobPropertyItem::childNumber(), getItem(), JobPropertyItem::parent(), and rootItem.
int JobPropertyModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() |
) | const |
Get the number of rows the item has
parent | the item to get the children it has |
Definition at line 153 of file jobpropertymodel.cpp.
References JobPropertyItem::childCount(), and getItem().
int JobPropertyModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() |
) | const |
Get the number of columns this model has
parent | where to get the number of columns |
Definition at line 39 of file jobpropertymodel.cpp.
References JobPropertyItem::columnCount(), and rootItem.
Qt::ItemFlags JobPropertyModel::flags | ( | const QModelIndex & | index | ) | const |
Get the flags the specified item has
index | how to get the item |
Definition at line 69 of file jobpropertymodel.cpp.
bool JobPropertyModel::setData | ( | const QModelIndex & | index, | |
const QVariant & | value, | |||
int | role = Qt::EditRole | |||
) |
Set the value of an item
index | how to get the item to edit | |
value | the value to set | |
role | role of this data |
Definition at line 168 of file jobpropertymodel.cpp.
References getItem(), and JobPropertyItem::setData().
bool JobPropertyModel::setHeaderData | ( | int | section, | |
Qt::Orientation | orientation, | |||
const QVariant & | value, | |||
int | role = Qt::EditRole | |||
) |
Set the header data
section | section of the header to edit | |
orientation | orientation | |
value | the value to set | |
role | role of this data |
Definition at line 187 of file jobpropertymodel.cpp.
References rootItem, and JobPropertyItem::setData().
void JobPropertyModel::emitLayoutAboutToBeChanged | ( | ) |
Emit the signal layoutAboutToBeChanged();
Definition at line 199 of file jobpropertymodel.cpp.
References _layoutAboutToBeChanged.
Referenced by JobPropertyItemNodes::addNode(), JobPropertyItemNode::createCustomContextMenu(), JobPropertyItemString::set(), JobPropertyItemNode::set(), and JobPropertyItemNodes::set().
void JobPropertyModel::emitLayoutChanged | ( | ) |
Emit the signal emit layoutChanged();
Definition at line 211 of file jobpropertymodel.cpp.
References _layoutAboutToBeChanged.
Referenced by JobPropertyItemNodes::addNode(), JobPropertyItemNode::createCustomContextMenu(), JobPropertyItemString::set(), JobPropertyItemNode::set(), and JobPropertyItemNodes::set().
JobPropertyItem * JobPropertyModel::getItem | ( | const QModelIndex & | index | ) | const |
Get the item at the specified index
index | how to get the item |
Definition at line 82 of file jobpropertymodel.cpp.
References rootItem.
Referenced by JobPropertyDelegate::createEditor(), data(), index(), JobPropertyDelegate::onCustomContextMenuRequested(), parent(), removeRows(), rowCount(), and setData().
Definition at line 49 of file jobpropertymodel.h.
Referenced by columnCount(), getItem(), headerData(), JobEditorWidget::JobEditorWidget(), JobPropertyModel(), parent(), setHeaderData(), and ~JobPropertyModel().
Definition at line 52 of file jobpropertymodel.h.
Referenced by emitLayoutAboutToBeChanged(), and emitLayoutChanged().