i have met strange issue with QSortFilterProxyModel. i've simplified my code to reflect this issue. suppose, we have a custom item model:
Qt Code:
  1. #define COL_CNT 7
  2.  
  3. class CustomModel : public QAbstractItemModel
  4. {
  5. Q_OBJECT
  6. public:
  7. explicit CustomModel(QObject *parent = 0) :
  8. {
  9. for(int i = 0; i < COL_CNT; ++i)
  10. cnt << 0;
  11. startTimer(1000);
  12. }
  13. QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const
  14. {
  15. if(!parent.isValid())
  16. return createIndex(row, column);
  17. else
  18. return QModelIndex();
  19. }
  20. QModelIndex parent(const QModelIndex &child) const
  21. {
  22. Q_UNUSED(child);
  23. return QModelIndex();
  24. }
  25. int rowCount(const QModelIndex &parent = QModelIndex()) const
  26. {
  27. if(!parent.isValid())
  28. return 1;
  29. else
  30. return 0;
  31. }
  32. int columnCount(const QModelIndex &parent = QModelIndex()) const
  33. {
  34. Q_UNUSED(parent);
  35. return COL_CNT;
  36. }
  37. QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const
  38. {
  39. Q_UNUSED(index);
  40. if(role == Qt::DisplayRole)
  41. return QVariant(cnt.at(index.column()));
  42. else
  43. return QVariant();
  44. }
  45.  
  46. protected:
  47. void timerEvent(QTimerEvent *)
  48. {
  49. for(int i = 0; i < COL_CNT; ++i)
  50. ++cnt[i];
  51. emit dataChanged(index(0, 0), index(0, COL_CNT));
  52. }
  53.  
  54. private:
  55. QList<int> cnt;
  56. };
To copy to clipboard, switch view to plain text mode 
when i connect this model to QTreeView
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv);
  4. CustomModel model;
  5. QTreeView tree;
  6. tree.setModel(&model);
  7. tree.show();
  8. return a.exec();
  9. }
To copy to clipboard, switch view to plain text mode 
i get what i expected - 1 row, 7 columns and increasing counter in every column. then i add generic QSortFilterProxyModel:
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv);
  4. CustomModel model;
  5. filter.setSourceModel(&model);
  6. QTreeView tree;
  7. tree.setModel(&filter);
  8. tree.show();
  9. return a.exec();
  10. }
To copy to clipboard, switch view to plain text mode 
and i get following behaviour: in first column (column == 0) counter increases every second, just as planned. but in other columns counter freezes and updates only when i put mouse over, or resize header, or something else

i have resolved this issue in the following way
Qt Code:
  1. void TransfersTreeSortFilterModel::mySetSourceModel(QAbstractItemModel *model)
  2. {
  3. setSourceModel(model);
  4. connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this,
  5. SLOT(sourceModelDataChanged(QModelIndex,QModelIndex)));
  6. }
  7.  
  8. void TransfersTreeSortFilterModel::sourceModelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
  9. {
  10. emit dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight));
  11. }
To copy to clipboard, switch view to plain text mode 
but actually i'm not sure this is a good solution

can somebody explain, is this Qt bug or am i missing something?