MapObjectItem *AbstractObjectTool::topMostObjectItemAt(QPointF pos) const { const QList<QGraphicsItem *> &items = mMapScene->items(pos); for (QGraphicsItem *item : items) { MapObjectItem *objectItem = qgraphicsitem_cast<MapObjectItem*>(item); if (objectItem && objectItem->mapObject()->objectGroup()->isUnlocked()) return objectItem; } return nullptr; }
QList<MapObjectItem*> AbstractObjectTool::objectItemsAt(QPointF pos) const { const QList<QGraphicsItem *> &items = mMapScene->items(pos); QList<MapObjectItem*> objectList; for (auto item : items) { MapObjectItem *objectItem = qgraphicsitem_cast<MapObjectItem*>(item); if (objectItem && objectItem->mapObject()->objectGroup()->isUnlocked()) objectList.append(objectItem); } return objectList; }