Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to move rectangle with mouse ?
QtWS25 Last Chance

How to move rectangle with mouse ?

Scheduled Pinned Locked Moved QML and Qt Quick
qt quickmoving
3 Posts 3 Posters 3.9k 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.
  • H Offline
    H Offline
    halil sogut
    wrote on 18 May 2015, 08:24 last edited by
    #1

    How can I move rectangle with drag and drop ?

    P 1 Reply Last reply 19 May 2015, 07:33
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 18 May 2015, 08:36 last edited by
      #2

      You need to add a MouseArea to it and set up the drag property: link.

      (Z(:^

      1 Reply Last reply
      1
      • H halil sogut
        18 May 2015, 08:24

        How can I move rectangle with drag and drop ?

        P Offline
        P Offline
        Pradeep P N
        wrote on 19 May 2015, 07:33 last edited by
        #3

        @halil-sogut

        Hi,
        Just add MouseArea and make target of rectangle which you want to drag. Use drag property and just set X and Y of the mouse to the Rectangle's X and Y.

        Pradeep Nimbalkar.
        Upvote the answer(s) that helped you to solve the issue...
        Keep code clean.

        1 Reply Last reply
        2

        2/3

        18 May 2015, 08:36

        • Login

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