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;
29
30 QtSvg::Options options() const;
31 void setOptions(QtSvg::Options options);
32public Q_SLOTS:
33 void load(const QString &file);
34 void load(const QByteArray &contents);
35protected:
36 void paintEvent(QPaintEvent *event) override;
37
38private:
39 Q_DISABLE_COPY(QSvgWidget)
40 Q_DECLARE_PRIVATE(QSvgWidget)
41};
42
43QT_END_NAMESPACE
44
45#endif // QSVGWIDGET_H
46

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

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