本文整理汇总了C++中TraceFunction::addPrettyLocation方法的典型用法代码示例。如果您正苦于以下问题:C++ TraceFunction::addPrettyLocation方法的具体用法?C++ TraceFunction::addPrettyLocation怎么用?C++ TraceFunction::addPrettyLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TraceFunction
的用法示例。
在下文中一共展示了TraceFunction::addPrettyLocation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QTreeWidgetItem
// for call lines
InstrItem::InstrItem(InstrView* iv, QTreeWidgetItem* parent, Addr addr,
TraceInstr* instr, TraceInstrCall* instrCall)
: QTreeWidgetItem(parent)
{
_view = iv;
_addr = addr;
_instr = instr;
_instrCall = instrCall;
_instrJump = 0;
_inside = true;
setTextAlignment(0, Qt::AlignRight);
setTextAlignment(1, Qt::AlignRight);
setTextAlignment(2, Qt::AlignRight);
//qDebug("InstrItem: (file %d, line %d) Linecall to %s",
// fileno, lineno, _lineCall->call()->called()->prettyName().toAscii());
SubCost cc = _instrCall->callCount();
QString callStr = " ";
if (cc==0)
callStr += QObject::tr("Active call to '%1'")
.arg(_instrCall->call()->calledName());
else
callStr += QObject::tr("%n call(s) to '%2'", "", (uint64)cc)
.arg(_instrCall->call()->calledName());
TraceFunction* calledF = _instrCall->call()->called();
calledF->addPrettyLocation(callStr);
setText(6, callStr);
updateGroup();
updateCost();
}
示例2: QTreeWidgetItem
// for call lines
SourceItem::SourceItem(SourceView* sv, QTreeWidgetItem* parent,
int fileno, unsigned int lineno,
TraceLine* line, TraceLineCall* lineCall)
: QTreeWidgetItem(parent)
{
_view = sv;
_lineno = lineno;
_fileno = fileno;
_inside = true;
_line = line;
_lineCall = lineCall;
_lineJump = 0;
setTextAlignment(0, Qt::AlignRight);
setTextAlignment(1, Qt::AlignRight);
setTextAlignment(2, Qt::AlignRight);
//qDebug("SourceItem: (file %d, line %d) Linecall to %s",
// fileno, lineno, _lineCall->call()->called()->prettyName().toAscii());
SubCost cc = _lineCall->callCount();
QString callStr = " ";
if (cc==0)
callStr += QObject::tr("Active call to '%1'")
.arg(_lineCall->call()->calledName());
else
callStr += QObject::tr("%n call(s) to '%2'", "", (uint64)cc)
.arg(_lineCall->call()->calledName());
TraceFunction* calledF = _lineCall->call()->called();
calledF->addPrettyLocation(callStr);
setText(4, callStr);
updateGroup();
updateCost();
}