当前位置: 首页>>代码示例>>C++>>正文


C++ TraceFunction::addPrettyLocation方法代码示例

本文整理汇总了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();
}
开发者ID:DeepCV,项目名称:kcachegrind,代码行数:36,代码来源:instritem.cpp

示例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();
}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:38,代码来源:sourceitem.cpp


注:本文中的TraceFunction::addPrettyLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。