blob: b0e2a0faa256a9fad02e66c5224fc46f211da7e2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QGRAPHICSSVGITEM_H
#define QGRAPHICSSVGITEM_H
#include <QtSvgWidgets/qtsvgwidgetsglobal.h>
#if !defined(QT_NO_GRAPHICSVIEW)
#include <QtWidgets/qgraphicsitem.h>
QT_BEGIN_NAMESPACE
class QSvgRenderer;
class QGraphicsSvgItemPrivate;
class Q_SVGWIDGETS_EXPORT QGraphicsSvgItem : public QGraphicsObject
{
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
Q_PROPERTY(QString elementId READ elementId WRITE setElementId)
Q_PROPERTY(QSize maximumCacheSize READ maximumCacheSize WRITE setMaximumCacheSize)
public:
QGraphicsSvgItem(QGraphicsItem *parentItem = nullptr);
QGraphicsSvgItem(const QString &fileName, QGraphicsItem *parentItem = nullptr);
void setSharedRenderer(QSvgRenderer *renderer);
QSvgRenderer *renderer() const;
void setElementId(const QString &id);
QString elementId() const;
void setCachingEnabled(bool);
bool isCachingEnabled() const;
void setMaximumCacheSize(const QSize &size);
QSize maximumCacheSize() const;
QRectF boundingRect() const override;
void paint(QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget = nullptr) override;
enum { Type = 13 };
int type() const override;
private:
Q_DISABLE_COPY(QGraphicsSvgItem)
Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QGraphicsSvgItem)
Q_PRIVATE_SLOT(d_func(), void _q_repaintItem())
};
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
#endif // QGRAPHICSSVGITEM_H
|