[Qt-interest] QAbstractItemModel::canFetchMore/fetchMore and view->selectAll

Girish Ramakrishnan girish at forwardbias.in
Tue Jun 23 07:20:27 CEST 2009


Scott Aron Bloom wrote:
> Does anyone else consider this a bug?
> 

I think the current behavior is correct. selectAll is just a shortcut to
'select all indices' and not 'select all indices that will ever appear'.

If we had the behavior your way (which is not wrong), you will have all
sorts of complications like when should the view stop following the
indices in the model and aggressively selecting them. What If I don't
actually want to select the new ones that have just been fetched? What
happens when model was cleared and new items are added. And so on.

On a side note, your code won't work, if fetchMore does not fetch items
immediately.

Girish



More information about the Qt-interest-old mailing list