Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Itemview (insert in modal)

    General and Desktop
    2
    3
    1272
    Loading More Posts
    • 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
      Immii last edited by

      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 Reply Quote 0
      • A
        andre last edited by

        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 Reply Quote 0
        • I
          Immii last edited by

          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 Reply Quote 0
          • First post
            Last post