Clarification about dataChanged
Hello,
I need an explanation about dataChanged() and beginInsertRows/endInsertRows().
I have implemented a model using QAbstractTableModel class and the model is editable; I'm not using setData() method to update the model but my own method that add or update an item to the model.
Can the method emit dataChanged() when item is inserted or I must use beginInsertRows/endInsertRows?
Or do both of beginInsertRows and endInsertRows emit dataChanged()?
Thank you a lot!
Re: Clarification about dataChanged
Quote:
Originally Posted by
airbites
Can the method emit dataChanged() when item is inserted or I must use beginInsertRows/endInsertRows?
It must use beginInsertRows() and endInsertRows().
Quote:
Or do both of beginInsertRows and endInsertRows emit dataChanged()?
They don't. dataChanged() is emitted only for existing indexes (there has to be some data first for it to change).
Re: Clarification about dataChanged
Thank you wysota. That really makes things clear ;)