[Qt-interest] Question about Models, Roles and data
Brad Howes
howes at ll.mit.edu
Tue Aug 25 17:58:12 CEST 2009
On Aug 25, 2009, at 11:41 AM, Murphy, Sean M. wrote:
> So my question is, how many models do I create to get all the
> different
> slices into my data? Is the general rule of thumb that I need one
> model
> per data class per view type? Or can I play around with custom
> roles to
> reduce the number of model classes I need?
If the indices change depending on the view, then I would recommend a
different model. Otherwise, your code will get complicated very
quickly with conditionals. Note that you can have a main model class
and various proxy classes that do the modelIndex translation
appropriate for the lists you want to manipulate. But in truth, the
proxy class is really a separate modeling of the underlying data.
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