bool REA
::ZoneRecognizersModel::moveUp (quint32 row,
QModelIndex const &parent
) { TreeItem *pItm = (TreeItem*)parent.internalPointer();
if (!pItm) pItm = _root;
if (row<=0 || row>=pItm->children.size())
return false;
quint32 dstRow = row-1;
beginMoveRows (parent, row, row, parent, dstRow);
pItm->children.swap (row, dstRow);
endMoveRows ();
return true;
}
bool REA
::ZoneRecognizersModel::moveDown (quint32 row,
QModelIndex const &parent
) { TreeItem *pItm = (TreeItem*)parent.internalPointer();
if (!pItm) pItm = _root;
if (row<0 || row>=pItm->children.size()-1)
return false;
quint32 dstRow = row+1;
beginMoveRows (parent, row, row, parent, dstRow);
pItm->children.swap (dstRow, row);
endMoveRows ();
return true;
}
bool REA::ZoneRecognizersModel::moveUp (quint32 row, QModelIndex const &parent) {
TreeItem *pItm = (TreeItem*)parent.internalPointer();
if (!pItm) pItm = _root;
if (row<=0 || row>=pItm->children.size())
return false;
quint32 dstRow = row-1;
beginMoveRows (parent, row, row, parent, dstRow);
pItm->children.swap (row, dstRow);
endMoveRows ();
return true;
}
bool REA::ZoneRecognizersModel::moveDown (quint32 row, QModelIndex const &parent) {
TreeItem *pItm = (TreeItem*)parent.internalPointer();
if (!pItm) pItm = _root;
if (row<0 || row>=pItm->children.size()-1)
return false;
quint32 dstRow = row+1;
beginMoveRows (parent, row, row, parent, dstRow);
pItm->children.swap (dstRow, row);
endMoveRows ();
return true;
}
To copy to clipboard, switch view to plain text mode
Bookmarks