Results 1 to 3 of 3

Thread: Model, View and Proxy

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2006
    Posts
    35
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Model, View and Proxy

    I am fairly new to Qt. I have read through the Qt 4.2.1 documentation, but some questions remain:

    I have some data inside a tree like this:
    A
    - 1
    - x y z
    - 2
    - x y z
    - a b c
    - d e f
    B
    - 1
    -x y z
    C
    - 1
    -x y z

    I want to use the MVC concept to display and edit this data in two views: one tree view and one table view:

    table view:
    A
    - 1
    - 2
    B
    - 1
    C
    - 1

    list view (depending on tree view selection; here A 2 was selected by the user):
    x y z
    a b c
    d e f

    Further the tree view can be hidden and the table view should show all data in a flat view:
    A 1 x y z
    A 2 x y z
    A 2 a b c
    A 2 d e f
    B 1 x y z
    C 1 x y z

    How would I implement this correctly?

    - Do I implement two models, one for the tree view and one for the table view or do I implement one model to access all data and two proxies filtering the data needed for each view?

    - Would I add another filtering proxy to the table view that filters the rows based on if the tree view is shown and subclass the view to hide the first two colums if needed? Or would the proxy filter the colums also?

    - How do I notify the model about changes inside the data that occured outside the MVC?

    - Where would I add the editing delegates? To the model or the proxy? I only want editing to be done inside the table view. Changes to the tree view data is done internally (some buttons).

    Thanks in advance, sorry for my bad english, greetings from Germany,
    -Jens
    Last edited by No-Nonsense; 20th November 2006 at 17:33. Reason: updated contents

Similar Threads

  1. Sharing Selections between Model and ProxyModel
    By mentat in forum Qt Programming
    Replies: 14
    Last Post: 27th January 2010, 17:31
  2. data, model and tree view
    By larry104 in forum Qt Programming
    Replies: 17
    Last Post: 3rd July 2006, 14:43
  3. Filter Proxy Model to Autoupdate View
    By Big Duck in forum Qt Programming
    Replies: 1
    Last Post: 1st June 2006, 20:32
  4. setIndexWidget and proxy interaction
    By Derf in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2006, 18:15

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.