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. Itemview (insert in modal)
Forum Updated to NodeBB v4.3 + New Features

Itemview (insert in modal)

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k 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.
  • I Offline
    I Offline
    Immii
    wrote on last edited by
    #1

    Hi i have a long tree and every node can have n number of child, If I need to copy one of the root node which has n number of child and paste that in another node, I want that another node should have every child node of the copied node copied in it as if they were there own child nodes.
    any hint how to do it?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Use a [[doc:QSortFilterProxyModel]]. Reimplement the filterAcceptsRow() method to only return true if the row belongs to (a decendant of) the item you're interested in. Create an instance of your proxy model, set the source model to your original model, and use the proxy model as the model for your filtered view.

      1 Reply Last reply
      0
      • I Offline
        I Offline
        Immii
        wrote on last edited by
        #3

        Andre: I think you missed the whole point, I want my original source model modified when this copy paste happens, If Node five gets copied and pasted to node three then i have insert this node five in model under child of node three.
        I was wondering how to insert this recursive index(of childs) which Node five might have.

        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