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.
  • BharathiB Offline
    BharathiB Offline
    Bharathi
    wrote on last edited by
    #1

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

    K 1 Reply Last reply
    0
    • BharathiB Bharathi

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

      K Offline
      K Offline
      koahnig
      wrote on 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
      • BharathiB Offline
        BharathiB Offline
        Bharathi
        wrote on last edited by
        #3

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

        mrjjM 1 Reply Last reply
        0
        • BharathiB Bharathi

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

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on 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
          • BharathiB Offline
            BharathiB Offline
            Bharathi
            wrote on last edited by
            #5

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

            J.HilkJ 1 Reply Last reply
            0
            • BharathiB Bharathi

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

              J.HilkJ Online
              J.HilkJ Online
              J.Hilk
              Moderators
              wrote on 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

              • Login

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