28 #include <QHeaderView>
44 _showCallers = showCallers;
47 labels << tr(
"Incl." );
50 labels << tr(
"Distance" ),
51 labels << tr(
"Called" ),
52 labels << tr(
"Caller" );
56 labels << tr(
"Self" ),
57 labels << tr(
"Distance" ),
58 labels << tr(
"Calling" ),
59 labels << tr(
"Callee" );
61 setHeaderLabels(labels);
64 setIconSize(QSize(99,99));
65 setAllColumnsShowFocus(
true);
66 setRootIsDecorated(
false);
67 setUniformRowHeights(
true);
69 sortByColumn(0, Qt::DescendingOrder);
78 setContextMenuPolicy(Qt::CustomContextMenu);
80 SIGNAL(customContextMenuRequested(
const QPoint &) ),
87 connect(header(), SIGNAL(sectionClicked(
int)),
94 tr(
"<b>List of all Callers</b>"
95 "<p>This list shows all functions calling the "
96 "current selected one, either directly or with "
97 "several functions in-between on the stack; the "
98 "number of functions in-between plus one "
99 "is called the <em>Distance</em> (e.g. "
100 "for function A,B,C there exists a call from "
101 "A to C when A calls B and B calls C, i.e. "
102 "A => B => C. The distance here is 2).</p>"
104 "<p>Absolute cost shown is the cost spent in the "
105 "selected function while a listed function is active; "
106 "relative cost is the percentage of all cost spent in "
107 "the selected function while the listed one is "
108 "active. The cost graphic shows logarithmic "
109 "percentage with a different color for each "
112 "<p>As there can be many calls from the same function, "
113 "the distance column sometimes shows "
114 "the range of distances for all "
115 "calls happening; then, in parentheses, there is the "
116 "medium distance, i.e. the distance where most of the "
117 "call costs happened.</p>"
119 "<p>Selecting a function makes it the current selected "
120 "one of this information panel. "
121 "If there are two panels (Split mode), the "
122 "function of the other panel is changed instead.</p>") :
124 tr(
"<b>List of all Callees</b>"
125 "<p>This list shows all functions called by the "
126 "current selected one, either directly or with "
127 "several function in-between on the stack; the "
128 "number of function in-between plus one "
129 "is called the <em>Distance</em> (e.g. "
130 "for function A,B,C there exists a call from "
131 "A to C when A calls B and B calls C, i.e. "
132 "A => B => C. The distance here is 2).</p>"
134 "<p>Absolute cost shown is the cost spent in the "
135 "listed function while the selected is active; "
136 "relative cost is the percentage of all cost spent in "
137 "the listed function while the selected one is active. "
138 "The cost graphic always shows logarithmic "
139 "percentage with a different color for each "
142 "<p>As there can be many calls to the same function, "
143 "the distance column sometimes shows "
144 "the range of distances for all "
145 "calls happening; then, in parentheses, there is the "
146 "medium distance, i.e. the distance where most of the "
147 "call costs happened.</p>"
149 "<p>Selecting a function makes it the current selected "
150 "one of this information panel. "
151 "If there are two panels (Split mode), the "
152 "function of the other panel is changed instead.</p>");
157 int c = columnAt(p.x());
168 QAction* activateFunctionAction = 0;
171 activateFunctionAction = popup.addAction(menuText);
172 popup.addSeparator();
175 if ((c == 0) || (!_showCallers && c == 1)) {
177 popup.addSeparator();
181 QAction* a = popup.exec(mapToGlobal(p + QPoint(0,header()->height())));
182 if (a == activateFunctionAction)
217 if ((col == 1) || (col==3))
return;
220 if ((col == 2) || (col==4))
return;
224 sortByColumn(col, Qt::DescendingOrder);
230 if (item && ((event->key() == Qt::Key_Return) ||
231 (event->key() == Qt::Key_Space)))
239 QTreeView::keyPressEvent(event);
256 void CoverageView::doUpdate(
int changeType,
bool)
276 for (
int i=0; i<topLevelItemCount(); i++) {
277 item = this->topLevelItem(i);
283 setCurrentItem(item);
292 for (
int i=0; i<topLevelItemCount();i++) {
293 item = topLevelItem(i);
305 void CoverageView::refresh()
360 setSortingEnabled(
false);
361 addTopLevelItems(items);
362 setSortingEnabled(
true);
364 header()->setSortIndicatorShown(
false);
366 header()->resizeSections(QHeaderView::ResizeToContents);
369 #include "coverageview.moc"
SubCost subCost(EventType *)
Returns a sub cost.
CoverageView(bool showCallers, TraceItemView *parentView, QWidget *parent=0)
static TraceFunctionList coverage(TraceFunction *f, CoverageMode m, EventType *ct)
Calculate coverage of all functions based on function f.
void addEventTypeMenu(QMenu *, bool withCost2=true)
ProfileContext::Type type() const
QString whatsThis() const
Base class for cost items.
void selectedSlot(QTreeWidgetItem *, QTreeWidgetItem *)
ProfileContext::Type _groupType
TraceAssoziation * assoziation(int rtti)
Abstract Base Class for KCachegrind Views.
QList< TraceFunction * > TraceFunctionList
void activatedSlot(QTreeWidgetItem *, int)
QString prettyName() const
Similar to name, but prettyfied = more descriptive to humans.
static QString shortenSymbol(const QString &)
virtual void selected(TraceItemView *sender, CostItem *)
Notification from child views.
virtual void activated(TraceItemView *sender, CostItem *)
void addCost(ProfileCostArray *, SubCost)
void keyPressEvent(QKeyEvent *event)
Cost event counter, simple wrapper around a 64bit entity.
void context(const QPoint &)
static int maxListCount()
ProfileCostArray * inclusive()