Hello,
back to real problems :)
I was trying to find info about nested WAbstractItemModel or
QAbstractItemModel and, but nothing to be found...
I have a complex tree like data structure, where different subtrees
have particular implementations. Of course the entire logic could fit
into one subclass of WAbstractItemModel, but as implementation detail
might grow i have to split the item model into separate pieces.
The question is if it would be enough to implement WMyModel::index
that would retrieve WModelIndex to children, sthg. like:
WModelIndex WMyModel::index(int row, int col, parent)
{
//this is the root "column" so we do not look at parent
// datacontainer is a vector of boost tuples of label, key, childModel
if( !get<2>( datacontainer_[row] ) /
// me have to create the nested model
// the second element of the tuple contains the key of the model type
get<2>( datacontainer_[row] ) = myFactory->createModel(
get<1>(container_[row]) )
}
return get<2>( container_[row] ).index(row, col);
}
--
rgrds,
mobi phil
being mobile, but including technology
http://mobiphil.com
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest