Inherits QAbstractItemModel.
|
| | StreamAlignerModel (QObject *parent=0) |
| |
| | ~StreamAlignerModel () |
| |
| virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| |
| virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
| |
| virtual QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
| |
| virtual QModelIndex | parent (const QModelIndex &child) const |
| |
| virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| |
| virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| |
| void | updateData (const aggregator::StreamAlignerStatus &status) |
| |
Definition at line 203 of file StreamAlignerWidget.cpp.
◆ StreamAlignerModel()
| StreamAlignerModel::StreamAlignerModel |
( |
QObject * |
parent = 0 | ) |
|
|
explicit |
◆ ~StreamAlignerModel()
| StreamAlignerModel::~StreamAlignerModel |
( |
| ) |
|
Definition at line 221 of file StreamAlignerWidget.cpp.
223 for(std::vector<TaskRepresentation *>::const_iterator it = taskRep.begin(); it != taskRep.end(); it++)
◆ columnCount()
| int StreamAlignerModel::columnCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
|
virtual |
◆ data()
| QVariant StreamAlignerModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
|
virtual |
Definition at line 281 of file StreamAlignerWidget.cpp.
287 if(
index.internalId() == 1)
289 return taskRep[
index.row()]->data(
index.column(), role);
293 return taskRep[
index.parent().row()]->data(
index.row(),
index.column(), role);
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
◆ headerData()
| QVariant StreamAlignerModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
|
virtual |
◆ index()
| QModelIndex StreamAlignerModel::index |
( |
int |
row, |
|
|
int |
column, |
|
|
const QModelIndex & |
parent = QModelIndex() |
|
) |
| const |
|
virtual |
Definition at line 298 of file StreamAlignerWidget.cpp.
300 if (!hasIndex(row, column,
parent))
301 return QModelIndex();
306 const int taskCount = taskRep.size();
308 return QModelIndex();
309 return createIndex(row, column, 1);
311 if(
parent.internalId() != 1)
312 throw std::runtime_error(
"Expected id 1 got something else");
314 if(row < taskRep[
parent.row()]->getStreamCount())
315 return createIndex(row, column, (
void *) taskRep[
parent.row()] );
318 return QModelIndex();
virtual QModelIndex parent(const QModelIndex &child) const
◆ parent()
| QModelIndex StreamAlignerModel::parent |
( |
const QModelIndex & |
child | ) |
const |
|
virtual |
Definition at line 321 of file StreamAlignerWidget.cpp.
323 if(!child.isValid()) {
324 return QModelIndex();
328 if(child.internalId() == 1)
329 return QModelIndex();
332 for(std::vector<TaskRepresentation *>::const_iterator it = taskRep.begin(); it != taskRep.end(); it++) {
333 if(*it == child.internalPointer())
334 return createIndex(i, 0, 1);
337 return QModelIndex();
◆ rowCount()
| int StreamAlignerModel::rowCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
|
virtual |
Definition at line 261 of file StreamAlignerWidget.cpp.
266 if(
parent.internalId() != 1)
270 return taskRep[
parent.row()]->getStreamCount();
273 return taskRep.size();
virtual QModelIndex parent(const QModelIndex &child) const
◆ updateData()
| void StreamAlignerModel::updateData |
( |
const aggregator::StreamAlignerStatus & |
status | ) |
|
Definition at line 231 of file StreamAlignerWidget.cpp.
233 std::string name = status.name;
235 name =
"<anonymous>";
237 if(!taskRepMap.count(name))
240 taskRepMap[name] = tp;
241 taskRep.push_back(tp);
242 emit layoutChanged();
245 taskRepMap[name]->updateData(status);
249 emit dataChanged(createIndex(0,0,0), createIndex(taskRep.size()-1, 5, 0));
The documentation for this class was generated from the following file: