1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #ifndef ABOUTDIALOG_H |
5 | #define ABOUTDIALOG_H |
6 | |
7 | #include <QtWidgets/QTextBrowser> |
8 | #include <QtWidgets/QDialog> |
9 | #include <QtCore/QMap> |
10 | |
11 | #include <QtCore/QMap> |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | class QLabel; |
16 | class QPushButton; |
17 | class QGridLayout; |
18 | |
19 | class AboutLabel : public QTextBrowser |
20 | { |
21 | Q_OBJECT |
22 | |
23 | public: |
24 | AboutLabel(QWidget *parent = nullptr); |
25 | void setText(const QString &text, const QByteArray &resources); |
26 | QSize minimumSizeHint() const override; |
27 | |
28 | private: |
29 | QVariant loadResource(int type, const QUrl &name) override; |
30 | |
31 | void doSetSource(const QUrl &name, QTextDocument::ResourceType type) override; |
32 | |
33 | QMap<QString, QByteArray> m_resourceMap; |
34 | }; |
35 | |
36 | class AboutDialog : public QDialog |
37 | { |
38 | Q_OBJECT |
39 | |
40 | public: |
41 | AboutDialog(QWidget *parent = nullptr); |
42 | void setText(const QString &text, const QByteArray &resources); |
43 | void setPixmap(const QPixmap &pixmap); |
44 | QString documentTitle() const; |
45 | |
46 | private: |
47 | void updateSize(); |
48 | |
49 | QLabel *m_pixmapLabel; |
50 | AboutLabel *m_aboutLabel; |
51 | QPushButton *m_closeButton; |
52 | QGridLayout *m_layout; |
53 | }; |
54 | |
55 | QT_END_NAMESPACE |
56 | |
57 | #endif |
58 |