Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Moving items in QTreeView
Forum Updated to NodeBB v4.3 + New Features

Moving items in QTreeView

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 290 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.
  • ivanicyI Offline
    ivanicyI Offline
    ivanicy
    wrote on last edited by
    #1

    Hello!!

    I need to move items inside a QTreeView. With the QTreeView properties I can do it, but I need to avoid the case that I move an item inside another item. I don't want to create item children. I only want to move the items order.

    How can I do it?

    Thank you very much!

    JonBJ 1 Reply Last reply
    0
    • ivanicyI ivanicy

      Hello!!

      I need to move items inside a QTreeView. With the QTreeView properties I can do it, but I need to avoid the case that I move an item inside another item. I don't want to create item children. I only want to move the items order.

      How can I do it?

      Thank you very much!

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @ivanicy
      QTreeView simply displays the parent, child & sibling hierarchy of its model. Get things in the right place there and the treeview will reflect it. You cannot move items, remove them from where you don't want them and insert them where you do.

      but I need to avoid the case that I move an item inside another item. I don't want to create item children. I only want to move the items order.

      You have to "move an item inside another item" if you want to change parent/child/depth. If only at sibling level, remove and re-insert as desired.

      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