QModelIndex ApiTraceModel::index(int row, int column,
const QModelIndex &parent) const
{
- if (parent.isValid() && parent.column() != 0)
+ if ((parent.isValid() && parent.column() != 0) || column != 0)
return QModelIndex();
ApiTraceEvent *event = item(parent);
this, SLOT(invalidateFrames()));
connect(m_trace, SIGNAL(framesInvalidated()),
this, SLOT(invalidateFrames()));
- connect(m_trace, SIGNAL(framesAdded(int, int)),
- this, SLOT(appendFrames(int, int)));
+ connect(m_trace, SIGNAL(beginAddingFrames(int, int)),
+ this, SLOT(beginAddingFrames(int, int)));
+ connect(m_trace, SIGNAL(endAddingFrames()),
+ this, SLOT(endAddingFrames()));
connect(m_trace, SIGNAL(changed(ApiTraceCall*)),
this, SLOT(callChanged(ApiTraceCall*)));
}
endResetModel();
}
-void ApiTraceModel::appendFrames(int oldCount, int numAdded)
+void ApiTraceModel::beginAddingFrames(int oldCount, int numAdded)
{
beginInsertRows(QModelIndex(), oldCount,
oldCount + numAdded - 1);
- endInsertRows();
}
ApiTraceEvent * ApiTraceModel::item(const QModelIndex &index) const
emit dataChanged(index, index);
}
+void ApiTraceModel::endAddingFrames()
+{
+ endInsertRows();
+}
+
#include "apitracemodel.moc"