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. How to find intersection of two rectangle in qt?
Forum Updated to NodeBB v4.3 + New Features

How to find intersection of two rectangle in qt?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 2.4k Views 2 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.
  • B Offline
    B Offline
    Bharathi
    wrote on 2 Dec 2017, 13:34 last edited by
    #1

    How to find intersection of two rectangle(i.e.QRect) in qt??

    K 1 Reply Last reply 2 Dec 2017, 13:48
    0
    • B Bharathi
      2 Dec 2017, 13:34

      How to find intersection of two rectangle(i.e.QRect) in qt??

      K Offline
      K Offline
      koahnig
      wrote on 2 Dec 2017, 13:48 last edited by
      #2

      @Bharathi

      How about this?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      6
      • B Offline
        B Offline
        Bharathi
        wrote on 2 Dec 2017, 13:55 last edited by
        #3

        if any intersection between two rectangle is there ,the function will return true something like that..

        M 1 Reply Last reply 2 Dec 2017, 15:34
        0
        • B Bharathi
          2 Dec 2017, 13:55

          if any intersection between two rectangle is there ,the function will return true something like that..

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 2 Dec 2017, 15:34 last edited by
          #4

          @Bharathi
          Did you read the link ?
          Its right under the function @koahnig suggested.

          bool QRect::intersects(const QRect &rectangle) const
          
          Returns true if this rectangle intersects with the given rectangle (i.e., there is at least one pixel that is within both rectangles), otherwise returns false.
          

          It does exactly that.

          1 Reply Last reply
          10
          • B Offline
            B Offline
            Bharathi
            wrote on 5 Dec 2017, 06:41 last edited by
            #5

            Give me an example,it will be more useful@mrjj

            J 1 Reply Last reply 5 Dec 2017, 06:49
            0
            • B Bharathi
              5 Dec 2017, 06:41

              Give me an example,it will be more useful@mrjj

              J Offline
              J Offline
              J.Hilk
              Moderators
              wrote on 5 Dec 2017, 06:49 last edited by
              #6

              @Bharathi seriously ?

              //bool QRect::intersects(const QRect &rectangle) const
              bool trueOrNot = myRectangle.intersects(withOtherRectangle); //?
              

              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              1 Reply Last reply
              6

              1/6

              2 Dec 2017, 13:34

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved