Motiv
Marvelous OTF2 Traces Interactive Visualizer
Loading...
Searching...
No Matches
InformationDock.hpp
1/*
2 * Marvelous OTF2 Traces Interactive Visualizer (MOTIV)
3 * Copyright (C) 2023 Florian Gallrein, Björn Gehrke
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef MOTIV_INFORMATIONDOCK_HPP
19#define MOTIV_INFORMATIONDOCK_HPP
20
21
22#include "TimeUnitLabel.hpp"
23#include "src/ui/TraceDataProxy.hpp"
24#include "src/ui/widgets/infostrategies/InformationDockElementStrategy.hpp"
25#include <QLabel>
26#include <QFormLayout>
27#include <QDockWidget>
28
34class InformationDock : public QDockWidget {
35Q_OBJECT
36public:
41 explicit InformationDock(QWidget *parent = nullptr);
42 ~InformationDock() override;
43
44public:
54
55public:
56Q_SIGNALS:
63 void zoomToWindow(types::TraceTime from, types::TraceTime to);
64
65private Q_SLOTS:
66
70 void zoomIntoViewPressed();
71
72public Q_SLOTS:
73
81 void setElement(TimedElement *element);
82
83protected:
90 virtual void updateView();
91
92private: // fields
93 TimedElement *element_ = nullptr;
94
95private:
96 std::vector<std::pair<QWidget*, InformationDockElementStrategy*>> strategies_ {};
97};
98
99
100#endif //MOTIV_INFORMATIONDOCK_HPP
A base class for strategies for the InformationDock to show information about a TimedElement.
A UI component that shows additional information.
void zoomToWindow(types::TraceTime from, types::TraceTime to)
Signal indicating to zoom to a specific time window.
void addElementStrategy(InformationDockElementStrategy *s)
Add a strategy to display information for specific items.
virtual void updateView()
Updates the view.
void setElement(TimedElement *element)
Sets the current element.
A base class for all elements with a start and end time.