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. [SOLVED] How to intersect two QRects from widgets with different parents?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] How to intersect two QRects from widgets with different parents?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.6k 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.
  • J Offline
    J Offline
    jesuisbenjamin
    wrote on last edited by
    #1

    I would like to intersect my rubberband's geometry with another widget of my application. Those do not have the same parent widget, so intersection of their QRect is pointless. QRect does not own a parent either.

    How can I achieve that?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dmcr
      wrote on last edited by
      #2

      Hello,

      I don't understand why you mention that the intersection of the two QRect is pointless.
      The QRects are properties of a widget, but can be used to calculate a new QRect.
      What you want to do with the resulting QRect is another question, but if you just want to have the coordinates of the intersection of the Widgets at a time, this is definitively possible.

      dmcr

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jesuisbenjamin
        wrote on last edited by
        #3

        I've posted the question on "StackOverflow":http://stackoverflow.com/questions/10679083/how-to-get-the-intersection-of-geometry-of-two-qwidgets-with-different-parents/10679225#comment13858209_10679225 and got the answer to my question, which regard the intersection of two QRects from widgets with different parents i.e the coordinates of which refer to different origins.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dmcr
          wrote on last edited by
          #4

          So you can then add [SOLVED] to the discussion :)

          dmcr

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jesuisbenjamin
            wrote on last edited by
            #5

            Yes I can.

            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