1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QSVGWIDGET_H
5#define QSVGWIDGET_H
6
7#include <QtSvgWidgets/qtsvgwidgetsglobal.h>
8#include <QtWidgets/qwidget.h>
9
10
11QT_BEGIN_NAMESPACE
12
13
14class QSvgWidgetPrivate;
15class QPaintEvent;
16class QSvgRenderer;
17
18class Q_SVGWIDGETS_EXPORT QSvgWidget : public QWidget
19{
20 Q_OBJECT
21public:
22 QSvgWidget(QWidget *parent = nullptr);
23 QSvgWidget(const QString &file, QWidget *parent = nullptr);
24 ~QSvgWidget();
25
26 QSvgRenderer *renderer() const;
27
28 QSize sizeHint() const override;
29public Q_SLOTS:
30 void load(const QString &file);
31 void load(const QByteArray &contents);
32protected:
33 void paintEvent(QPaintEvent *event) override;
34private:
35 Q_DISABLE_COPY(QSvgWidget)
36 Q_DECLARE_PRIVATE(QSvgWidget)
37};
38
39QT_END_NAMESPACE
40
41#endif // QSVGWIDGET_H
42

source code of qtsvg/src/svgwidgets/qsvgwidget.h