Example #1
0
void EditorViewMViface::handleEdgeElementsForRowsInserted(
		const QList<QPair<EdgeElement *, QPersistentModelIndex>> &edges
		, const QModelIndex &parent
		)
{
	for (const QPair<EdgeElement *, QPersistentModelIndex> &p : edges) {
		EdgeElement *elem = p.first;
		QPersistentModelIndex current = p.second;

		if (elem) {
			QPointF ePos = model()->data(current, roles::positionRole).toPointF();
			// setting position before parent definition 'itemChange' to work correctly
			elem->setPos(ePos);
			handleAddingSequenceForRowsInserted(parent, elem, current);
			handleElemDataForRowsInserted(elem, current);
			elem->adjustLink();
			elem->layOut();
		}
	}
}