Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Detect if two items overlap

Detect if two items overlap

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 2.7k 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.
  • E Offline
    E Offline
    Etchelon
    wrote on last edited by
    #1

    Hi, I'd like to know if there's a ready property or method to detect if two items, say two Text elements, overlap, so I can put enough distance between them :)

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      AFAIK, there's no such ready property in QML.

      157

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dasRicardo
        wrote on last edited by
        #3

        Hmmm, i would implement a simple collision detection like bound box. "LINK....":https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection
        If the elements on the same y axis it's enough to calculate the distance between the x axis and move the second element up to a distance bigger then the width of the first element.

        **Sorry for my english :)

        PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          In case of collision detection, "this":http://developer.nokia.com/community/wiki/Collision_Detection_In_QtQuick would also be a good start.

          157

          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