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 * MultiView, enclosing multiple (default: 2) TabView's with a user 0011 * choosable active view (i.e. focus). This is a splitter itself. 0012 * Selection of the active view is shown in the next to the right view 0013 * (with wrap around). 0014 */ 0015 0016 #ifndef MULTIVIEW_H 0017 #define MULTIVIEW_H 0018 0019 #include <QSplitter> 0020 #include <QList> 0021 0022 #include "traceitemview.h" 0023 0024 class TabView; 0025 0026 class MultiView : public QSplitter, public TraceItemView 0027 { 0028 Q_OBJECT 0029 0030 public: 0031 explicit MultiView(TopLevelBase* top, QWidget* parent = nullptr); 0032 0033 QWidget* widget() override { return this; } 0034 TabView* activeTabView() const { return _active; } 0035 void setData(TraceData*) override; 0036 0037 void appendView(); 0038 void removeView(); 0039 void setChildCount(int); 0040 int childCount() { return _views.count(); } 0041 0042 void selected(TraceItemView*, CostItem*) override; 0043 void activated(TraceItemView*, CostItem*) override; 0044 0045 void saveLayout(const QString& prefix, const QString& postfix) override; 0046 void restoreLayout(const QString& prefix, const QString& postfix) override; 0047 void saveOptions(const QString& prefix, const QString& postfix) override; 0048 void restoreOptions(const QString& prefix, const QString& postfix) override; 0049 0050 public Q_SLOTS: 0051 void tabActivated(TabView*); 0052 0053 private: 0054 void doUpdate(int, bool) override; 0055 0056 TabView* _active; 0057 QList<TabView*> _views; 0058 }; 0059 0060 #endif