Results 1 to 4 of 4

Thread: ItemAt and ScenePos

  1. #1
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default ItemAt and ScenePos

    Hi,

    I have an item at scenePos x,y. But QGraphicsScene::itemAt(x, y) returns 0.

    I think this should be impossible... but it happens :S

    The item is a QGraphicsRectItem, maybe the border is too thin?

    thanks!
    Last edited by jano_alex_es; 23rd October 2009 at 12:08.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: ItemAt and ScenePos

    Please provide a minimal compilable example reproducing the problem.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: ItemAt and ScenePos

    Hi,

    I suggest you to check the x,y values in the itemAt function.

  4. #4
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: ItemAt and ScenePos

    I was checking them that's why I was sure it wasn't able to find the item where it should do.

    Anyway, it's solved. I wasn't doing "prepareGeometryChange", I was subclassing events I shouldn't subclass and where I shouldn't do it... and now it works fine

    thanks!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.