1

This is driving me crazy. I have a QAbstractItemModel, QSortFilterProxyModel, and a QStyledItemDelegate. All are subclassed. After emitting the following dataChanged(), QStyledItemDelegate::paint() should be called for just those two indexes (0,0, and 0,1). However, I've confirmed it's being called for all visible cells.

void my_model_t::emit_data_changed()
{
    QModelIndex start_ix    = createIndex( 0, 0 );
    QModelIndex end_ix  = createIndex( 0, 1 );
    emit( dataChanged( start_ix, end_ix ) );
}

To be sure, I have connected a slot to both my model & proxy's modelReset(), and layoutChanged() signals. It does a simple printf(). However, it is never called. I'm pretty sure I'm doing nothing funky with the view or delegate. But, not exactly sure where to look either.

kiss-o-matic
  • 1,111
  • 16
  • 32

1 Answers1

0

Double post from the Qt Forums:

I dug through the call stack a little, and started catching more slots. I was catching my QTableView's dataChanged() and paintEvent()'s. Basically QTableView::dataChanged() is mangling the coordinates.

It is apparently behaving as expected. Absolutely shameful documentation if you ask me. There is a huge asterisk missing from QAbstractItemModel::dataChanged() signal and QAbstractItemView::dataChanged() slot.

Hope nobody else has this problem, and if they do, they can find this thread.

http://qt-project.org/forums/viewthread/14723

kiss-o-matic
  • 1,111
  • 16
  • 32