本文整理汇总了C++中SourceItem::line方法的典型用法代码示例。如果您正苦于以下问题:C++ SourceItem::line方法的具体用法?C++ SourceItem::line怎么用?C++ SourceItem::line使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SourceItem
的用法示例。
在下文中一共展示了SourceItem::line方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doUpdate
void SourceView::doUpdate(int changeType)
{
// Special case ?
if (changeType == selectedItemChanged) {
if (!_selectedItem) {
clearSelection();
return;
}
TraceLine* sLine = 0;
if (_selectedItem->type() == TraceItem::Line)
sLine = (TraceLine*) _selectedItem;
if (_selectedItem->type() == TraceItem::Instr)
sLine = ((TraceInstr*)_selectedItem)->line();
SourceItem* si = (SourceItem*)QListView::selectedItem();
if (si) {
if (si->line() == sLine) return;
if (si->lineCall() &&
(si->lineCall()->call()->called() == _selectedItem)) return;
}
QListViewItem *item, *item2;
for (item = firstChild();item;item = item->nextSibling()) {
si = (SourceItem*)item;
if (si->line() == sLine) {
ensureItemVisible(item);
_inSelectionUpdate = true;
setCurrentItem(item);
_inSelectionUpdate = false;
break;
}
item2 = item->firstChild();
for (;item2;item2 = item2->nextSibling()) {
si = (SourceItem*)item2;
if (!si->lineCall()) continue;
if (si->lineCall()->call()->called() == _selectedItem) {
ensureItemVisible(item2);
_inSelectionUpdate = true;
setCurrentItem(item2);
_inSelectionUpdate = false;
break;
}
}
if (item2) break;
}
return;
}
if (changeType == groupTypeChanged) {
QListViewItem *item, *item2;
for (item = firstChild();item;item = item->nextSibling())
for (item2 = item->firstChild();item2;item2 = item2->nextSibling())
((SourceItem*)item2)->updateGroup();
}
refresh();
}
示例2: updateSourceItems
void SourceView::updateSourceItems()
{
setColumnWidth(1, 50);
setColumnWidth(2, _costType2 ? 50:0);
// Allow resizing of column 2
setColumnWidthMode(2, QListView::Maximum);
if (_costType)
setColumnText(1, _costType->name());
if (_costType2)
setColumnText(2, _costType2->name());
SourceItem* si;
QListViewItem* item = firstChild();
for (;item;item = item->nextSibling()) {
si = (SourceItem*)item;
TraceLine* l = si->line();
if (!l) continue;
si->updateCost();
QListViewItem *next, *i = si->firstChild();
for (;i;i = next) {
next = i->nextSibling();
((SourceItem*)i)->updateCost();
}
}
if (!_costType2) {
setColumnWidthMode(2, QListView::Manual);
setColumnWidth(2, 0);
}
}