Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Shifting Rectangles



  • I am using the drag (horizontal) property of MouseArea in a rectangle(R1) of geometry say 800x650.
    Inside this rectangle I have another rectangle(R2) of geometry R1.width/2 x 2.(It is basically a line vertically centered to R1 and its width is half of R1). This rectangle is the target for drag.
    I want that when i drag the line and a part of it goes beyond the right side of R1, the part which gets hidden should start coming from left side of R1 and vice versa.


  • Qt Champions 2017

    Start working with x & y of R2. When you drag x & y of R2 changes. Trying to control the drag using the x & y.

    If you give sample program it helps better frame the solution as well.


Log in to reply