本文整理汇总了C++中ApiTraceFrame::callIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ ApiTraceFrame::callIndex方法的具体用法?C++ ApiTraceFrame::callIndex怎么用?C++ ApiTraceFrame::callIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiTraceFrame
的用法示例。
在下文中一共展示了ApiTraceFrame::callIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: indexForCall
QModelIndex ApiTraceModel::indexForCall(ApiTraceCall *call) const
{
if (!call) {
return QModelIndex();
}
ApiTraceFrame *frame = call->parentFrame();
Q_ASSERT(frame);
int row = frame->callIndex(call);
if (row < 0) {
qDebug() << "Couldn't find call num "<<call->index()<<" inside parent!";
return QModelIndex();
}
return createIndex(row, 0, call);
}
示例2: stateSetOnEvent
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->callIndex(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);
}
}
示例3: callChanged
void ApiTraceModel::callChanged(ApiTraceCall *call)
{
ApiTrace *trace = call->parentFrame()->parentTrace();
#if 0
qDebug()<<"Call changed = "<<call->edited();
qDebug()<<"\ttrace edited = "<<trace->edited();
qDebug()<<"\ttrace file = "<<trace->fileName();
qDebug()<<"\ttrace needs saving = "<<trace->needsSaving();
#endif
Q_ASSERT(trace);
if (trace->needsSaving())
trace->save();
ApiTraceFrame *frame = call->parentFrame();
int row = frame->callIndex(call);
QModelIndex index = createIndex(row, 0, call);
emit dataChanged(index, index);
}