1 Attachment(s)
Using QGraphicsScene::itemAt, ignoring certain types of QGraphicsItems
I have two types of QGraphicsItems in my graphics scene: GraphicNodes (with rectangle-, ellipse- and diamond-shaped implementations) and GraphicArcs (arrows that currently lack an arrow head). When I use QGraphicsScene::itemAt to get the topmost object at a certain position, I want the GraphicArcs to be ignored.
Attachment 6236
In other words, I want to use itemAt as if there were no GraphicArcs on the scene, therefore returning the topmost GraphicNode at that position (if any). Is this possible?
Re: Using QGraphicsScene::itemAt, ignoring certain types of QGraphicsItems
Use QGraphicsScene::items() variant that takes a QPoint and iterate over the list you get until you find an item that suits your needs.