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 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | |
14 | class QSvgWidgetPrivate; |
15 | class QPaintEvent; |
16 | class QSvgRenderer; |
17 | |
18 | class Q_SVGWIDGETS_EXPORT QSvgWidget : public QWidget |
19 | { |
20 | Q_OBJECT |
21 | public: |
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; |
29 | public Q_SLOTS: |
30 | void load(const QString &file); |
31 | void load(const QByteArray &contents); |
32 | protected: |
33 | void paintEvent(QPaintEvent *event) override; |
34 | private: |
35 | Q_DISABLE_COPY(QSvgWidget) |
36 | Q_DECLARE_PRIVATE(QSvgWidget) |
37 | }; |
38 | |
39 | QT_END_NAMESPACE |
40 | |
41 | #endif // QSVGWIDGET_H |
42 |