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. Sending an event when an QRect intersects another
Forum Updated to NodeBB v4.3 + New Features

Sending an event when an QRect intersects another

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 789 Views 1 Watching
  • 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.
  • Q Offline
    Q Offline
    qtBeginner
    wrote on last edited by
    #1

    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?

    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