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
13QT_BEGIN_NAMESPACE
14
15class QLabel;
16class QPushButton;
17class QGridLayout;
18
19class AboutLabel : public QTextBrowser
20{
21 Q_OBJECT
22
23public:
24 AboutLabel(QWidget *parent = nullptr);
25 void setText(const QString &text, const QByteArray &resources);
26 QSize minimumSizeHint() const override;
27
28private:
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
36class AboutDialog : public QDialog
37{
38 Q_OBJECT
39
40public:
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
46private:
47 void updateSize();
48
49 QLabel *m_pixmapLabel;
50 AboutLabel *m_aboutLabel;
51 QPushButton *m_closeButton;
52 QGridLayout *m_layout;
53};
54
55QT_END_NAMESPACE
56
57#endif
58

source code of qttools/src/assistant/assistant/aboutdialog.h