Project

General

Profile

Actions

Bug #913

closed

setModel followed by other table commands result in undefined state

Added by Anonymous over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
07/21/2011
Due date:
% Done:

0%

Estimated time:

Description

Take WTableView as a case, where one calls in order

WAbstractItemModel* model = getNewWAbstractItemModel(); // generate new model

WTableView* tv = getTableView(); // gets current defined table view

tv.setModel( model );

const WModelIndex index ( model->index( model.rowCount(), model.columnCount() ); // get last cell in model

tv.scrollTo(index );

tv.select( index );

The last two calls are operating over the tableview where the row/column values are taken from the prior model, as the setModel, will invalidate some of the values (i.e. first/last column are set to --1, while rows keep their value). So if the new model has more rows, than the prior model, then scrollTo/select will be ignored, as the new model hasn't been rendered yet into the table view.

Basically the problem is that until the new model is rendered into the table view, the table view has values from the prior model (or has invalidated some values in anticipation of the table view render).

In such a case, these calls, scrollTo/select, should be queue, and applied when the table view is rendered with the new model.


Files

test192.cc (2.43 KB) test192.cc Koen Deforche, 08/09/2011 02:58 PM
Actions #1

Updated by Koen Deforche over 13 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche
  • Target version set to 3.1.11
Actions #2

Updated by Koen Deforche over 13 years ago

Hey,

I could not reproduce this. See attached test case. Can you modify this test case to reproduce the problem ?

Regards,

koen

Actions #3

Updated by Koen Deforche about 13 years ago

  • Target version changed from 3.1.11 to 3.2.0
Actions #4

Updated by Koen Deforche about 13 years ago

  • Status changed from Feedback to Resolved

Closed due to lack of feedback.

Actions #5

Updated by Koen Deforche almost 13 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF