+void ApiTraceModel::stateSetOnEvent(ApiTraceEvent *event)
+{
+ if (!event)
+ return;
+
+ if (event->type() == ApiTraceEvent::Call) {
+ ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
+ ApiTraceFrame *frame = call->parentFrame;
+ int row = frame->calls.indexOf(call);
+ QModelIndex index = createIndex(row, 0, call);
+ emit dataChanged(index, index);
+ } else if (event->type() == ApiTraceEvent::Frame) {
+ ApiTraceFrame *frame = static_cast<ApiTraceFrame*>(event);
+ const QList<ApiTraceFrame*> frames = m_trace->frames();
+ int row = frames.indexOf(frame);
+ QModelIndex index = createIndex(row, 0, frame);
+ emit dataChanged(index, index);
+ }
+}
+