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. QGraphicsScene ::itemAt() ,not returning the item[CLOSED]
Forum Update on Monday, May 27th 2025

QGraphicsScene ::itemAt() ,not returning the item[CLOSED]

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 642 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.
  • K Offline
    K Offline
    karim24
    wrote on last edited by
    #1

    @void MyScene:: mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
    {
    QGraphicsItem *item=itemAt(mouseEvent->screenPos(),QTransform());
    QPointF p1=mouseEvent->scenePos();//i get a valid point
    QPointF p2=item->scenePos();////i get (0,0) even when i click on a valid items

    update();
    QGraphicsScene::mouseReleaseEvent(mouseEvent);
    }
    @

    MyScene inherits :QGraphicsScene and QObject
    the items in MyScene :inherit QGraphicsItem

    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