[solved] itemAt() in 5.3 depreciated ?
-
"docs 5.3":http://qt-project.org/doc/qt-5/qgraphicsscene-compat.html
@QGraphicsItem * QGraphicsScene::itemAt(const QPointF & position) const@
itemAt() is depreciated in 5.3
How to get @QGraphicsItem@
in
@mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)@
now ?
@Use the overload that takes a QTransform instead.@
I do not know/ understand how to use it in code.
thank you -
Its says "This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a QTransform instead." so the problem is QTransform the new function is
http://qt-project.org/doc/qt-5/qgraphicsscene.html#itemAt
@QGraphicsItem * QGraphicsScene::itemAt(const QPointF & position, const QTransform & deviceTransform) const@
-
yes but where do get const QTransform & deviceTransform from ?
and what ist it.@QGraphicsScene->itemAt(mouseEvent->scenePos(), ????? );@
-
I think there's a problem in old release to check if there're an item at pos x y If the scene was rotated.
So if you not use Transform maybe you can pass a default QTransform() or QGraphicsView::transform() . -
OK, works now, thank you :)
Post 3 of 5