Motiv
Marvelous OTF2 Traces Interactive Visualizer
Loading...
Searching...
No Matches
About.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_ABOUT_HPP
19#define MOTIV_ABOUT_HPP
20
21#include <QWidget>
22
23#define LN "<br>"
24
30class About : public QWidget {
31public:
39 explicit About(QWidget *parent = nullptr) : QWidget(parent) {
40 this->setAttribute(Qt::WA_DeleteOnClose);
41
42 auto topLayout = new QHBoxLayout;
43 topLayout->setAlignment(Qt::AlignTop | Qt::AlignLeading);
44 topLayout->setSizeConstraint(QLayout::SetFixedSize);
45 this->setLayout(topLayout);
46
47 QPixmap appIcon(":res/motiv.png");
48 appIcon = appIcon.scaled(200, 200);
49 auto appIconImage = new QLabel;
50 appIconImage->setPixmap(appIcon);
51 topLayout->addWidget(appIconImage);
52
53 topLayout->addSpacing(20);
54
55 QString string;
56 QTextStream text(&string);
57 text << "<b>Marvelous OTF2 Trace Interactive Visualizer</b>" << LN
58 << "<i>Version " MOTIV_VERSION_STRING "</i>" << LN << LN
59 << tr("Motiv is a free and open source application for viewing and analyzing OTF2 traces.") << LN << LN
60 << "Copyright 2023 Motiv contributors" << LN
61 << "<ul>"
62 << "<li><a href=\"" MOTIV_SOURCE_URL "\">View source code</a></li>"
63 << "<li><a href=\"" MOTIV_ISSUES_URL "\">Report issue</a></li>"
64 << "</ul>";
65
66 auto label = new QLabel(string, this);
67 label->setWordWrap(true);
68 label->setFixedWidth(400);
69 label->setTextFormat(Qt::RichText);
70 label->setTextInteractionFlags(Qt::TextBrowserInteraction);
71 label->setOpenExternalLinks(true);
72 topLayout->addWidget(label);
73 }
74};
75
76#endif //MOTIV_ABOUT_HPP
A widget showcasing information about this software.
Definition: About.hpp:30
About(QWidget *parent=nullptr)
Definition: About.hpp:39