Ejemplo n.º 1
0
void CallView::refresh()
{
    clear();
    setColumnWidth(1, _eventType2 ? 50:0);

    if (_eventType)
        _headerLabels[0] = _eventType->name();
    if (_eventType2)
        _headerLabels[1] = _eventType2->name();
    setHeaderLabels(_headerLabels);

    if (!_data || !_activeItem) return;

    TraceFunction* f = activeFunction();
    if (!f) return;

    TraceCall* call;
    // In the call lists, we skip cycles to show the real call relations
    TraceCallList l = _showCallers ? f->callers(true) : f->callings(true);

    QList<QTreeWidgetItem*> items;
    for (call=l.first();call;call=l.next())
	if (call->subCost(_eventType)>0)
            items.append(new CallItem(this, 0, call));

    // when inserting, switch off sorting for performance reason
    setSortingEnabled(false);
    addTopLevelItems(items);
    setSortingEnabled(true);
    // enabling sorting switches on the indicator, but we want it off
    header()->setSortIndicatorShown(false);
    // resize to content now (section size still can be interactively changed)
    header()->resizeSections(QHeaderView::ResizeToContents);

    if (!_eventType2)
        setColumnWidth(1, 0);
}