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. QTree model architecture
QtWS25 Last Chance

QTree model architecture

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 2.7k 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.
  • M Offline
    M Offline
    marcvs
    wrote on last edited by
    #1

    Hi all,

    I have a view/model application using QTreeView and a proxy (all code in PySide/Cython/numpy).
    I use to sort my tree (depth up to 7) using my own function but it was quite difficult to propagate modifications and I think, at the end, the application was in an inconsistent state (probably bad indexes). Then I changed to use the proxy. It looks like the indexes are much better now but I still have some architecture concerns as the sort is not called when I modify the tree, I need a piece of advice:

    • The source model has a setData which allows a node name to be changed, then the sort has to be performed again
    • But the setData is in the source model and has no knowledge of the proxy model, I cannot propagate any dataChanged or rowsMoved

    Do the sourceModel has to re-emit its own messages to the proxy (rowsMoved, dataChanged...) ?
    How can I ask the sourceModel to trigger the proxy model so that the node name change is taken into account ?
    Should I move the setData into the proxy model ?

    see source :

    line780 into http://pycgns.hg.sourceforge.net/hgweb/pycgns/pycgns/file/5b5c82525535/NAVigater/CGNS/NAV/mtree.pyx

    warning: lines 798 to 801 cannot work because instead of self. I should use the proxy model... it has been committed for the purpose of this forum.

    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