File indexing completed on 2024-04-28 05:41:35
0001 /* 0002 This file is part of KCachegrind. 0003 0004 SPDX-FileCopyrightText: 2003-2016 Josef Weidendorfer <Josef.Weidendorfer@gmx.de> 0005 0006 SPDX-License-Identifier: GPL-2.0-only 0007 */ 0008 0009 #ifndef PARTLISTITEM_H 0010 #define PARTLISTITEM_H 0011 0012 #include <QTreeWidget> 0013 0014 #include "tracedata.h" 0015 0016 /** 0017 * For info tab, trace part list. 0018 * Needs update on 0019 * - cost type change 0020 * 0021 * Note: on a cost item / percentage change, the list is rebuild 0022 */ 0023 class PartListItem: public QTreeWidgetItem 0024 { 0025 public: 0026 PartListItem(QTreeWidget* parent, TraceCostItem* costItem, 0027 EventType* ct, ProfileContext::Type gt, TracePart* part); 0028 0029 bool operator<(const QTreeWidgetItem& other) const override; 0030 ProfileCostArray* partCostItem() { return _partCostItem; } 0031 void setEventType(EventType* ct); 0032 void setGroupType(ProfileContext::Type); 0033 TracePart* part() { return _part; } 0034 void update(); 0035 0036 private: 0037 SubCost _sum, _pure; 0038 SubCost _callCount; 0039 EventType* _eventType; 0040 ProfileCostArray* _partCostItem; 0041 TracePart* _part; 0042 ProfileContext::Type _groupType; 0043 }; 0044 0045 #endif // PARTLISTITEM_H