Sending an event when an QRect intersects another



  • I'm facing a problem about rectangle intersections. Notice I don't have any code written for this until now. I'm just thinking how to solve the problem.
    Ok, here we go. In my SceneView, I have some "QGraphicsPixmapItems":http://doc.qt.digia.com/qt/qgraphicspixmapitem.html that will move continously in my scene. I want to trap all of them to move only in the limits of my scene.

    I had the idea to add a signal to my QGraphicsPixmapItems to notify my scene each time a move is occured. And in my scene I could have another signal to notify my items when one of them are out of bounds of my sceneRect. The problem with this approach is processing. If I emit a signal each time a move occurs this characterizes polling and this is not I want.

    I know about methods intersected() and intersects() of QRect. But again, calling each time a move occurs for me it's not a good idea.
    Do you know a good idea for this problem?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.