Results 1 to 9 of 9

Thread: How to view just a part of a model ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Location
    France
    Posts
    34
    Thanks
    12
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question How to view just a part of a model ?

    Hye,

    I'm actually developping an application in PyQt, with Qt4.1 and python 2.4
    I have done my own QAbstractItemModel class (here 'M'), for managing my data (a tree like structure).
    I've got already a QTreeView (here called 'S') connected to this model and it work great.

    But, I would like that when a user click an element (or an index if you prefer here call 'I')of my tree:
    • display a new window (here is 'C')in my workspace (easy)
    • this window have a widget whitch is a treeview like item (just a treeview would be the best (I'm a bit lazy :P))
    • the model for the view should be 'M' (such as for 'S') BUT i do not want to display the parent (and siblings) of 'I', just his children


    I try to make a 'picture':

    Qt Code:
    1. The Tree in 'S':
    2. [A]
    3. |-[H]
    4. |-[I]
    5. | |-[K]
    6. | |-[L]
    7. ...
    8.  
    9. The quiet same tree in 'C':
    10. [I]
    11. |-[K]
    12. |-[L]
    13. ...
    To copy to clipboard, switch view to plain text mode 
    Does anyone know how can I do this ?
    Last edited by weepdoo; 6th June 2007 at 17:21. Reason: reformatted to look better

Similar Threads

  1. hierarchical model in a flat view
    By gniking in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2009, 20:17
  2. Model, View and Proxy
    By No-Nonsense in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2006, 08:50
  3. Model - View Programming doubt.
    By munna in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2006, 13:01
  4. Replies: 6
    Last Post: 20th April 2006, 10:23
  5. Model, view, resize to show all data
    By jcr in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2006, 20:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.