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

Scott Aron Bloom Scott.Bloom at sabgroup.com
Tue Jun 23 02:57:07 CEST 2009


Im wondering if this is a bug..

 

If you have an model, that is not 100% fetched at initial construction,
say one of the SQL based models.  And one of the views connected to it,
does a select all.. Shouldn't the list of selected indexes be all of the
indexes for the model, not just those that have been currently fetched?

 

The reason this has come up for me, I have a SQL table, that the GUI
allows for bulk modification.  Using a selectAll than action flow on the
selected Items returned frm the selectionModel on the view.

 

The problem, calling selectAll only selects the items that have been
fetched..

 

If I connect the selectAll button to the following method instead,
everything works fine.

 

void realSelectAll()

{

   while ( model->canFetchMore() )

      model->fetchMore();

  view->selectall();

}

 

 

Does anyone else consider this a bug?

Scott

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090622/74b79b58/attachment.html 


More information about the Qt-interest-old mailing list