SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
aboutdialog.h
Go to the documentation of this file.
1
12#ifndef ABOUTDIALOG_H
13#define ABOUTDIALOG_H
14
15#include <QDialog>
16#include <QString>
17#include <QVector>
18
19class QLabel;
20class QLineEdit;
21class QPlainTextEdit;
22class QPushButton;
23class QSortFilterProxyModel;
24class QStandardItemModel;
25class QTreeView;
26
32class AboutDialog : public QDialog
33{
34 Q_OBJECT
35
36public:
37
41 struct Component {
42 QString category;
43 QString name;
44 QString version;
45 QString role;
46 QString homepage;
47 QString sourceUrl;
48 QString spdx;
49 QString provenance;
50 QString licenseFile;
51 };
52
53 explicit AboutDialog(QWidget *parent = nullptr);
54 ~AboutDialog() override;
55
61 [[nodiscard]] static QVector<Component>
62 parseManifest(const QByteArray &json, QString *errorOut = nullptr);
63
67 [[nodiscard]] const QVector<Component> &components() const { return m_components; }
68
69private slots:
70 void onSelectionChanged();
71 void onSearchTextChanged(const QString &text);
72 void onCopyLicense();
73 void onOpenHomepage();
74 void onOpenSource();
75
76private:
77 void buildUi();
78 void loadManifest();
79 void populateTree();
80 void showComponent(const Component &c);
81 void showApplicationOverview();
82
83 QVector<Component> m_components;
84
85 // Header strip
86 QLabel *m_headerLabel = nullptr;
87 QPushButton *m_copyEnvButton = nullptr;
88
89 // Master list
90 QLineEdit *m_searchEdit = nullptr;
91 QStandardItemModel *m_treeModel = nullptr;
92 QSortFilterProxyModel *m_treeProxy = nullptr;
93 QTreeView *m_tree = nullptr;
94
95 // Detail pane
96 QLabel *m_nameLabel = nullptr;
97 QLabel *m_metaLabel = nullptr;
98 QPlainTextEdit *m_licenseText = nullptr;
99 QPushButton *m_copyButton = nullptr;
100 QPushButton *m_homepageButton = nullptr;
101 QPushButton *m_sourceButton = nullptr;
102
103 int m_currentComponent = -1; // index into m_components
104};
105
106#endif // ABOUTDIALOG_H
Two-pane modal: master list of every shipped component (left) + per-component license + metadata deta...
Definition aboutdialog.h:33
~AboutDialog() override
static QVector< Component > parseManifest(const QByteArray &json, QString *errorOut=nullptr)
Parses a manifest JSON document into a vector of Component rows.
Definition aboutdialog.cpp:216
const QVector< Component > & components() const
Returns the list of components currently loaded into the dialog.
Definition aboutdialog.h:67
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
QString text
Definition queryparser.cpp:35
One row in the manifest. Public so tests can construct one.
Definition aboutdialog.h:41
QString sourceUrl
URL to source download (may be empty)
Definition aboutdialog.h:47
QString homepage
URL (may be empty)
Definition aboutdialog.h:46
QString spdx
SPDX license identifier (e.g. "MIT")
Definition aboutdialog.h:48
QString provenance
"vcpkg", "submodule", "in-tree copy", …
Definition aboutdialog.h:49
QString category
e.g. "Geospatial"
Definition aboutdialog.h:42
QString version
e.g. "3.9.2" (may be empty)
Definition aboutdialog.h:44
QString licenseFile
Qt-resource path to verbatim license text.
Definition aboutdialog.h:50
QString role
what it's used for
Definition aboutdialog.h:45
QString name
e.g. "GDAL"
Definition aboutdialog.h:43