Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [solved] itemAt() in 5.3 depreciated ?

    General and Desktop
    2
    5
    4523
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      deleted28 last edited by

      "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

      1 Reply Last reply Reply Quote 0
      • S
        stukdev last edited by

        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@

        1 Reply Last reply Reply Quote 0
        • D
          deleted28 last edited by

          yes but where do get const QTransform & deviceTransform from ?
          and what ist it.

          @QGraphicsScene->itemAt(mouseEvent->scenePos(), ????? );@

          1 Reply Last reply Reply Quote 0
          • S
            stukdev last edited by

            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() .

            1 Reply Last reply Reply Quote 0
            • D
              deleted28 last edited by

              OK, works now, thank you :)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post