Manuel wrote:
> Hello,
> 
> i have problems using QAbstractTableModel.
> 
> First, here is my code: http://pastebin.com/m2193e552
> 
> My TableModel is very simple. It should show some data from an ArrayList 
> of my program.
> The ArrayList is part of my program and is only referenced in the 
> TableModel (via Constructor).
> 
> So far so good.
> I manipulate the ArrayList outside the TableModel, eg in a Main-Method. 
> For example i add 3 objects to the ArrayList.

Do you surround your array manipulation with beginInsertRows() and 
endInsertRows()? Without this the results are undefined.

> But the crazy thing is, that the data() function will never be called 
> and no rows were shown.
> Even if i call the dataChanged.emit()-method nothing happens. The Table 
> stays empty.

the dataChanged signal only tells the model that the content of the 
given cell changed, not that the structure of the cells changed. You 
need to do use the begin/end functions to do that.

-
Best regards,
Gunnar
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to