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. Qml TreeView select on release

Qml TreeView select on release

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

    Hi guys,

    I want to implement some drag & drop functionality to TreeView but right now the item selection changes while I keep the mousebutton pressed.

    Is there a way to change the way the selection works now?

    Thx

    1 Reply Last reply
    0
    • Shrinidhi UpadhyayaS Offline
      Shrinidhi UpadhyayaS Offline
      Shrinidhi Upadhyaya
      wrote on last edited by
      #2

      Hi @themts , can you explain me in detail like what you are going to drag and drop and what should happen after you drop that item, and what kind of selection you want.
      If you can show me the code, it would be easier for me understand and help you out.

      Shrinidhi Upadhyaya.
      Upvote the answer(s) that helped you to solve the issue.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        themts
        wrote on last edited by
        #3

        There is no code yet.
        I need to copy items from one node to several other nodes.
        Therefor I would like to handle an onPressAndHold, create a fake-item which is semi-transparent above the treeView.
        While dragging this fake-item over the tree-view I would like to highlight the items which are hovered by mouse so the user knows where he is gonna drop.
        OnRelease I want to check the highlighted item and insert a new sub-element in this treeNode and hide my fake-item.

        The treeView is already working and has a c++-model.

        Shrinidhi UpadhyayaS 1 Reply Last reply
        0
        • T themts

          There is no code yet.
          I need to copy items from one node to several other nodes.
          Therefor I would like to handle an onPressAndHold, create a fake-item which is semi-transparent above the treeView.
          While dragging this fake-item over the tree-view I would like to highlight the items which are hovered by mouse so the user knows where he is gonna drop.
          OnRelease I want to check the highlighted item and insert a new sub-element in this treeNode and hide my fake-item.

          The treeView is already working and has a c++-model.

          Shrinidhi UpadhyayaS Offline
          Shrinidhi UpadhyayaS Offline
          Shrinidhi Upadhyaya
          wrote on last edited by
          #4

          @themts , ohh okay,but that's really difficult, inserting a sub-element etc is not a problem as you can handle it in c++, but the drag and drop functionality seems to be a bit diffcult because when you drag the fake-item over the tree view i dont think that you can highlight the currently hovered item because the focus of the mouse is on the fake-item.Please do share the way of implementation if somehow you get to do that, so that it will be helpful for me as well as others.

          Shrinidhi Upadhyaya.
          Upvote the answer(s) that helped you to solve the issue.

          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