File indexing completed on 2024-05-12 05:46:28

0001 /* This file is part of KCachegrind.
0002    Copyright (c) 2003-2016 Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
0003 
0004    This program is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU General Public
0006    License as published by the Free Software Foundation, version 2.
0007 
0008    This program is distributed in the hope that it will be useful,
0009    but WITHOUT ANY WARRANTY; without even the implied warranty of
0010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0011    General Public License for more details.
0012 
0013    You should have received a copy of the GNU General Public License
0014    along with this program; see the file COPYING.  If not, write to
0015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0016    Boston, MA 02110-1301, USA.
0017 */
0018 
0019 /*
0020  * Call Views
0021  */
0022 
0023 #ifndef CALLVIEW_H
0024 #define CALLVIEW_H
0025 
0026 #include <QTreeWidget>
0027 #include "tracedata.h"
0028 #include "traceitemview.h"
0029 
0030 class CallView: public QTreeWidget, public TraceItemView
0031 {
0032     Q_OBJECT
0033 
0034 public:
0035     CallView(bool showCallers, TraceItemView* parentView,
0036              QWidget* parent=nullptr);
0037 
0038     QWidget* widget() override { return this; }
0039     QString whatsThis() const override;
0040     bool showCallers() const { return _showCallers; }
0041 
0042 protected Q_SLOTS:
0043     void context(const QPoint &);
0044     void selectedSlot(QTreeWidgetItem*, QTreeWidgetItem*);
0045     void activatedSlot(QTreeWidgetItem*, int);
0046     void headerClicked(int);
0047 
0048 protected:
0049     void keyPressEvent(QKeyEvent* event) override;
0050 
0051 private:
0052     CostItem* canShow(CostItem*) override;
0053     void doUpdate(int, bool) override;
0054     void refresh();
0055     void setCostColumnWidths();
0056 
0057     bool _showCallers;
0058 };
0059 
0060 #endif