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
Bookmarks