Toolbox Qt
Loading...
Searching...
No Matches
dialogabout.h
1#ifndef TBQ_WIDGETS_DIALOGABOUT_H
2#define TBQ_WIDGETS_DIALOGABOUT_H
3
4#include "toolboxqt/toolboxqt_global.h"
5#include "toolboxqt/core/depinfos.h"
6#include "toolboxqt/core/richlink.h"
7#include "toolboxqt/widgets/labelscl.h"
8
9#include <QDialog>
10#include <QTabWidget>
11#include <QTableWidget>
12#include <QTextBrowser>
13#include <QVersionNumber>
14
15namespace tbq
16{
17
18class TOOLBOXQT_EXPORT DialogAbout : public QDialog
19{
20 Q_OBJECT
21
22public:
23 struct Ressource
24 {
25 RichLink source;
26 QString author;
27 QString license;
28 };
29
31 {
32 QString name;
33 QVector<Ressource> listRes;
34 };
35
36public:
37 using ListDeps = QVector<DepInfos>;
38 using ListResGroups = QVector<RessourceGroup>;
39
40public:
41 explicit DialogAbout(QWidget *parent = nullptr);
42
43public:
44 void setAppInfos(const QString &name, const QVersionNumber &version);
45 void setLogo(const QPixmap &logo);
46
47 void addSectionAbout(const QString &aboutApp, const RichLink &linkHome = RichLink(), const RichLink &linkBug = RichLink());
48 void addSectionDeps(const ListDeps &listDeps, const QString &invalidSemver = "/");
49 void addSectionRessources(const ListResGroups &listGroups);
50 void addSectionChangelog(const QUrl &sourceUrl, QTextDocument::ResourceType type = QTextDocument::MarkdownResource);
51 void addSectionLicense(const QUrl &sourceUrl, QTextDocument::ResourceType type = QTextDocument::MarkdownResource);
52
53 void addSectionFromDoc(const QString &name, const QUrl &sourceUrl, QTextDocument::ResourceType type);
54
55private:
56 QTableWidget* createRessourceGroup(const RessourceGroup &resGroup);
57
58 void labelSetInteractions(QLabel *label);
59 void handleDocsLinks(QTextBrowser *textArea, const QUrl &link);
60
61private:
62 void uiInitBase();
63
64private:
65 /* Basic properties */
66 LabelScl *m_labelIcon = nullptr;
67 QLabel *m_labelName = nullptr;
68 QLabel *m_labelVersion = nullptr;
69
70 /* Detailled properties */
71 QTabWidget *m_tabs = nullptr;
72};
73
74} // namespace tbq
75
76#endif // TBQ_WIDGETS_DIALOGABOUT_H
Allow to easily create an "about" dialog window.
Definition dialogabout.h:19
Label that will properly scale image or animation.
Definition labelscl.h:13
Definition dialogabout.h:31
Definition dialogabout.h:24