return;
for (int row = start; row <= end; row++) {
- QModelIndex child = parent.child(row, 0);
+ QModelIndex child = parent.model()->index(row, 0, parent);
newBuffer(child.data(NetworkModel::BufferIdRole).value<BufferId>());
}
}
return;
for (int row = start; row <= end; row++) {
- _bufferItemCache.remove(parent.child(row, 0).data(BufferIdRole).value<BufferId>());
+ _bufferItemCache.remove(index(row, 0, parent).data(BufferIdRole).value<BufferId>());
}
}
return;
for (int row = start; row <= end; row++) {
- QModelIndex child = parent.child(row, 0);
+ QModelIndex child = parent.model()->index(row, 0, parent);
_bufferItemCache[child.data(BufferIdRole).value<BufferId>()] = static_cast<BufferItem*>(child.internalPointer());
}
}
QModelIndex child;
for (int i = end; i >= start; i--) {
- child = parent.child(i, 0);
+ child = parent.model()->index(i, 0, parent);
Q_ASSERT(parentItem->child(i));
qDebug() << ">>>" << i << child << child.data().toString();
}
QModelIndex child;
for (int i = start; i <= end; i++) {
- child = parent.child(i, 0);
+ child = parent.model()->index(i, 0, parent);
Q_ASSERT(parentItem->child(i));
qDebug() << "<<<" << i << child << child.data().toString();
}
else {
// check if there are explicitly buffers removed
for (int i = start; i <= end; i++) {
- QVariant variant = parent.child(i, 0).data(NetworkModel::BufferIdRole);
+ QVariant variant = parent.model()->index(i, 0, parent).data(NetworkModel::BufferIdRole);
if (!variant.isValid())
continue;
else {
// check if there are explicitly buffers removed
for (int i = start; i <= end; i++) {
- QVariant variant = parent.child(i, 0).data(NetworkModel::BufferIdRole);
+ QVariant variant = parent.model()->index(i, 0, parent).data(NetworkModel::BufferIdRole);
if (!variant.isValid())
continue;
if (currentIndex.row() == 0)
newParent = lastNetIndex;
if (model()->hasChildren(newParent))
- resultingIndex = newParent.child(model()->rowCount(newParent) - 1, 0);
+ resultingIndex = newParent.model()->index(model()->rowCount(newParent) - 1, 0, newParent);
else
resultingIndex = newParent;
}
else {
if (model()->hasChildren(currentIndex))
- resultingIndex = currentIndex.child(0, 0);
+ resultingIndex = currentIndex.model()->index(0, 0, currentIndex);
else
resultingIndex = currentIndex.sibling(currentIndex.row() + 1, 0);
}
if (direction == Forward)
resultingIndex = model()->index(0, 0, QModelIndex());
else
- resultingIndex = lastNetIndex.child(model()->rowCount(lastNetIndex) - 1, 0);
+ resultingIndex = lastNetIndex.model()->index(model()->rowCount(lastNetIndex) - 1, 0, lastNetIndex);
}
selectionModel()->setCurrentIndex(resultingIndex, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
if (!source_parent.isValid())
return true;
- QModelIndex source_child = source_parent.child(source_row, 0);
+ QModelIndex source_child = source_parent.model()->index(source_row, 0, source_parent);
return (sourceModel()->data(source_child, NetworkModel::BufferIdRole).value<BufferId>() == _bufferId);
}