April 2018
Beginner
714 pages
18h 21m
English
If you want to know which item is shown at a certain position, you can use the QGraphicsScene::itemAt() function that takes the position in the scene's coordinate system (either a QPointF or two qreal numbers) and the device transformation object (QTransform) that can be obtained using the QGraphicsView::transform() function. The function returns the topmost item at the specified position or a null pointer if no item was found. The device transformation only matters if your scene contains items that ignore transformations. If you have no such items, you can use the default-constructed QTransform value:
QGraphicsItem *foundItem = scene.itemAt(scenePos, QTransform());
If your scene contains items that ignore transformations, ...
Read now
Unlock full access