本文整理汇总了C++中IdList::removeAll方法的典型用法代码示例。如果您正苦于以下问题:C++ IdList::removeAll方法的具体用法?C++ IdList::removeAll怎么用?C++ IdList::removeAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IdList
的用法示例。
在下文中一共展示了IdList::removeAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setItemsToDelete
void MultipleRemoveCommand::setItemsToDelete(IdList &itemsToDelete)
{
IdList itemsToUpdate;
addEdgesToBeDeleted(itemsToDelete);
// QGraphicsScene::selectedItems() returns items in no particular order,
// so we should handle parent-child relationships manually
while (!itemsToDelete.isEmpty()) {
const Id currentItem = itemsToDelete.at(0);
const IdList children = mGraphicalApi.children(currentItem);
foreach (const Id &child, children) {
itemsToDelete.removeAll(child);
// Child remove commands will be added in currentItem delete command
}
const bool isEdge = !mLogicalApi.editorManagerInterface().isGraphicalElementNode(currentItem);
if (isEdge) {
const Id src = mGraphicalApi.from(currentItem);
if (src != Id() && !itemsToUpdate.contains(src)) {
itemsToUpdate.append(src);
}
const Id dst = mGraphicalApi.to(currentItem);
if (dst != Id() && !itemsToUpdate.contains(dst)) {
itemsToUpdate.append(dst);
}
insertPreAction(graphicalDeleteCommand(currentItem), 0);
} else {
addPreAction(graphicalDeleteCommand(currentItem));
}
itemsToDelete.removeAll(currentItem);
}
示例2: getParents
IdList TestReparentingStrategy::getParents(const QModelIndex &sourceChildIndex, const IdList &ignore)
{
if (!sourceChildIndex.isValid()) {
kWarning() << "invalid index";
return IdList();
}
if (sourceChildIndex.data(ParentListRole).canConvert<IdList>()) {
IdList list = sourceChildIndex.data(ParentListRole).value<IdList>();
foreach (Id toRemove, ignore) {
list.removeAll(toRemove);
}