Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] itemAt() in 5.3 depreciated ?
QtWS25 Last Chance

[solved] itemAt() in 5.3 depreciated ?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 4.8k Views
  • 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 Offline
    D Offline
    deleted28
    wrote on last edited by
    #1

    "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
    0
    • S Offline
      S Offline
      stukdev
      wrote on last edited by
      #2

      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
      0
      • D Offline
        D Offline
        deleted28
        wrote on last edited by
        #3

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

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

        1 Reply Last reply
        0
        • S Offline
          S Offline
          stukdev
          wrote on last edited by
          #4

          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
          0
          • D Offline
            D Offline
            deleted28
            wrote on last edited by
            #5

            OK, works now, thank you :)

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved