1 /*
2     This file is part of KCachegrind.
3 
4     SPDX-FileCopyrightText: 2003-2016 Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
5 
6     SPDX-License-Identifier: GPL-2.0-only
7 */
8 
9 #ifndef PARTLISTITEM_H
10 #define PARTLISTITEM_H
11 
12 #include <QTreeWidget>
13 
14 #include "tracedata.h"
15 
16 /**
17  * For info tab, trace part list.
18  * Needs update on
19  * - cost type change
20  *
21  * Note: on a cost item / percentage change, the list is rebuild
22  */
23 class PartListItem: public QTreeWidgetItem
24 {
25 public:
26     PartListItem(QTreeWidget* parent, TraceCostItem* costItem,
27                  EventType* ct, ProfileContext::Type gt, TracePart* part);
28 
29     bool operator<(const QTreeWidgetItem& other) const override;
partCostItem()30     ProfileCostArray* partCostItem() { return _partCostItem; }
31     void setEventType(EventType* ct);
32     void setGroupType(ProfileContext::Type);
part()33     TracePart* part() { return _part; }
34     void update();
35 
36 private:
37     SubCost _sum, _pure;
38     SubCost _callCount;
39     EventType* _eventType;
40     ProfileCostArray* _partCostItem;
41     TracePart* _part;
42     ProfileContext::Type _groupType;
43 };
44 
45 #endif // PARTLISTITEM_H
46