Motiv
Marvelous OTF2 Traces Interactive Visualizer
Loading...
Searching...
No Matches
TimelineLabelList.cpp
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#include "TimelineLabelList.hpp"
19
20#include <QLabel>
21#include <QSizePolicy>
22#include <QVBoxLayout>
23
24TimelineLabelList::TimelineLabelList(TraceDataProxy *data, QWidget *parent) : QListWidget(parent), data(data) {
25 this->setFrameShape(QFrame::NoFrame);
26 this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
27 this->setStyleSheet("background: transparent");
28 setViewportMargins(0, 20, 0, 0);
29
30 for (const auto &ranks: this->data->getSelection()->getSlots()) {
31 const auto &rankName = ranks.first->name().str();
32 auto item = new QListWidgetItem(this);
33 item->setText(QString::fromStdString(rankName));
34 item->setSizeHint(QSize(0, 30 /* TODO ROW_HEIGHT */));
35 item->setTextAlignment(Qt::AlignCenter);
36 this->addItem(item);
37 }
38}
39
41 return;
42}
43
45 return;
46}
47
49 return;
50}
TimelineLabelList(TraceDataProxy *data, QWidget *parent=nullptr)
Creates a new instance of the TimelineLabelList class.
void mouseMoveEvent(QMouseEvent *event) override
void mouseReleaseEvent(QMouseEvent *event) override
void mousePressEvent(QMouseEvent *event) override
Model class providing access to data and pub/sub architecture of change events.
Trace * getSelection() const
Returns the current selection.
virtual std::map< otf2::definition::location_group *, Range< Slot * >, LocationGroupCmp > getSlots() const =0
Returns a map of slots of the current trace.