Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qgraphicssvgitem.h
Go to the documentation of this file.
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#ifndef QGRAPHICSSVGITEM_H
4#define QGRAPHICSSVGITEM_H
5
6#include <QtSvgWidgets/qtsvgwidgetsglobal.h>
7
8#if !defined(QT_NO_GRAPHICSVIEW)
9
10#include <QtWidgets/qgraphicsitem.h>
11
13
14
15class QSvgRenderer;
17
18class Q_SVGWIDGETS_EXPORT QGraphicsSvgItem : public QGraphicsObject
19{
22 Q_PROPERTY(QString elementId READ elementId WRITE setElementId)
23 Q_PROPERTY(QSize maximumCacheSize READ maximumCacheSize WRITE setMaximumCacheSize)
24
25public:
26 QGraphicsSvgItem(QGraphicsItem *parentItem = nullptr);
27 QGraphicsSvgItem(const QString &fileName, QGraphicsItem *parentItem = nullptr);
28
30 QSvgRenderer *renderer() const;
31
32 void setElementId(const QString &id);
33 QString elementId() const;
34
35 void setCachingEnabled(bool);
36 bool isCachingEnabled() const;
37
38 void setMaximumCacheSize(const QSize &size);
39 QSize maximumCacheSize() const;
40
41 QRectF boundingRect() const override;
42
45 QWidget *widget = nullptr) override;
46
47 enum { Type = 13 };
48 int type() const override;
49
50private:
51 Q_DISABLE_COPY(QGraphicsSvgItem)
52 Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QGraphicsSvgItem)
53
54 Q_PRIVATE_SLOT(d_func(), void _q_repaintItem())
55};
56
58
59#endif // QT_NO_GRAPHICSVIEW
60
61#endif // QGRAPHICSSVGITEM_H
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
QScopedPointer< QGraphicsItemPrivate > d_ptr
The QGraphicsObject class provides a base class for all graphics items that require signals,...
\inmodule QtSvgWidgets
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
\inmodule QtSvg
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QOpenGLWidget * widget
[1]
QPainter paint
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
GLuint GLenum option
static const QRectF boundingRect(const QPointF *points, int pointCount)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INTERFACES(x)
#define Q_PRIVATE_SLOT(d, signature)
QPainter painter(this)
[7]
black setSharedRenderer(renderer)
black setElementId(QLatin1String("black_joker"))
QSvgRenderer * renderer
[0]
Definition moc.h:23