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 /* 0010 * PartSelection for KCachegrind 0011 * For part file selection, to be put into a QDockWindow 0012 */ 0013 0014 #ifndef PARTSELECTION_H 0015 #define PARTSELECTION_H 0016 0017 #include <QWidget> 0018 #include <QPoint> 0019 0020 #include "tracedata.h" 0021 #include "traceitemview.h" 0022 0023 class QLabel; 0024 class TraceData; 0025 class TreeMapItem; 0026 class PartAreaWidget; 0027 0028 class PartSelection: public QWidget, public TraceItemView 0029 { 0030 Q_OBJECT 0031 0032 public: 0033 explicit PartSelection(TopLevelBase*, QWidget* parent = nullptr); 0034 0035 QWidget* widget() override { return this; } 0036 QString whatsThis() const override; 0037 void setData(TraceData*) override; 0038 0039 PartAreaWidget* graph() { return _partAreaWidget; } 0040 0041 void saveOptions(const QString& prefix, const QString& postfix) override; 0042 void restoreOptions(const QString& prefix, const QString& postfix) override; 0043 0044 Q_SIGNALS: 0045 void partsHideSelected(); 0046 void partsUnhideAll(); 0047 0048 public Q_SLOTS: 0049 void selectionChanged(); 0050 void doubleClicked(TreeMapItem*); 0051 void itemSelected(); 0052 void contextMenuRequested(TreeMapItem*, const QPoint &); 0053 void currentChangedSlot(TreeMapItem*, bool); 0054 0055 void hiddenPartsChangedSlot(const TracePartList& list); 0056 void showInfo(bool); 0057 0058 private: 0059 // reimplementations of TraceItemView 0060 CostItem* canShow(CostItem*) override; 0061 void doUpdate(int, bool) override; 0062 0063 // helper for doUpdate 0064 void selectParts(const TracePartList& list); 0065 void fillInfo(); 0066 0067 bool _showInfo; 0068 bool _diagramMode; 0069 bool _drawFrames; 0070 bool _inSelectionUpdate; 0071 0072 PartAreaWidget* _partAreaWidget; 0073 QLabel* _rangeLabel; 0074 }; 0075 0076 #endif