Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Shifting Rectangles
Qt 6.12 LTS is out! See what's new in the release blog

Shifting Rectangles

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 323 Views
  • 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.
  • S Offline
    S Offline
    SAHIL1804
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
      wrote on last edited by
      #2

      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.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      https://www.pthinks.com

      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
      • Unsolved