[Qt-interest] FW: QAbstractItemModel: Hiding rows

Brad Howes howes at ll.mit.edu
Fri Jul 10 17:52:30 CEST 2009


On Jul 10, 2009, at 4:32 AM, Arnold Krille wrote:

> So actually your model is already a proxy to the real data:-) And  
> all you want
> to know is what method of hiding some data from the proxies is least  
> costly.
> As I said, either 1) hide it directly in your model (yes, that  
> involves index-
> reordering) or 2) do it via a proxymodel (yes, that involves index-
> reordering)...

There is no reason at all to do it this way.

> The model-view concept is actualy working like this: The views show  
> everything
> exported by the model. And its the models responsibility to hide  
> what is not
> to be shown.

Wrong.

> If you try to introduce a new role, you also have to implement your  
> own
> views/delegates to be used with your model.

Wrong.

> And that is counter-productive. The advantage of the model-view- 
> pattern is that (almost) all views can display
> the data given in the model. Some my not look interesting (imagine a  
> chart-
> view coupled to a QDirModel:), but all work without modifications or  
> big
> specializations.


There are so many mischaracterizations of MVC and of how Qt does  
things here.

Brad

-- 
Brad Howes
Group 42
MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420








More information about the Qt-interest-old mailing list