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. Advice on approach needed QML GridView [SOLVED]
Qt 6.11 is out! See what's new in the release blog

Advice on approach needed QML GridView [SOLVED]

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    !http://2.bp.blogspot.com/-hJZqgQH3fHI/TsvJ-LqWSiI/AAAAAAAAAro/hk9CQ68DE-I/s1600/editmenu.jpg(Desired result)!

    So basically task is to make Icon arrangement in GridView similar to the one in N9: user press and hold, the icon he pressed becomes draggable while the rest icons are faded, upon release if the icon being dragged moves to a new grid = GridView indexes are updated accordingly and the icon we dragged takes new position.

    The way I see it being implemented is as follows:
    -> upon press and hold (MouseArea,onPressAndHold) the MouseArea drag.active becomes true
    -> then we start checking Mouse position changes
    -> each Grid slot then has its center position Mouse coordinates
    -> Upon dragged icon released if released mouse coordinates are in proximity of such Grid slot center position => we change index of dragged icon to the index of the icon which was previously occupying that slot

    So question is - is that optimal??

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Sorry - SOLVED of course...
      "SOLUTION":http://qt-project.org/wiki/Drag_and_Drop_within_a_GridView

      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