5#ifndef QT_NO_SVGRENDERER
12#if QT_CONFIG(mimetype)
18#include <private/qguiapplication_p.h>
64 if (
other.d->svgBuffers)
66 if (
other.d->addedPixmaps)
104 if (!
buf.isEmpty()) {
188 img.fill(0x00000000);
228#if QT_CONFIG(mimetype)
232 if (mimeTypeName ==
QLatin1String(
"image/svg+xml-compressed"))
245#ifndef QT_NO_COMPRESS
292#ifndef QT_NO_COMPRESS
299 qWarning(
"QSvgIconEngine: Can not decompress SVG data");
304 in >> hasAddedPixmaps;
305 if (hasAddedPixmaps) {
318 if (!
data.isEmpty()) {
319#ifndef QT_NO_COMPRESS
326 for (
int i=0;
i<num_entries; ++
i) {
344 int isCompressed = 0;
345#ifndef QT_NO_COMPRESS
356#ifndef QT_NO_COMPRESS
379#ifndef QT_NO_COMPRESS
T fetchAndAddRelaxed(T valueToAdd) noexcept
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
QString absoluteFilePath() const
Returns an absolute path including the file name.
static QGuiApplicationPrivate * instance()
virtual QPixmap applyQIconStyleHelper(QIcon::Mode, const QPixmap &basePixmap) const
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
const_iterator cbegin() const noexcept
T value(const Key &key) const noexcept
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
const_iterator cend() const noexcept
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
bool isEmpty() const noexcept
Returns true if the hash contains no items; otherwise returns false.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
The QIconEngine class provides an abstract base class for QIcon renderers.
virtual void virtual_hook(int id, void *data)
Mode
This enum type describes the mode for which a pixmap is intended to be used.
State
This enum describes the state for which a pixmap is intended to be used.
@ Format_ARGB32_Premultiplied
QMimeType mimeTypeForFile(const QString &fileName, MatchMode mode=MatchDefault) const
Returns a MIME type for the file named fileName using mode.
QString name
the name of the MIME type
qreal devicePixelRatio() const
The QPainter class performs low-level painting on widgets and other paint devices.
QPaintDevice * device() const
Returns the paint device on which this painter is currently painting, or \nullptr if the painter is n...
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
static bool find(const QString &key, QPixmap *pixmap)
Looks for a cached pixmap associated with the given key in the cache.
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
QSize size() const
Returns the size of the pixmap.
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
\inmodule QtCore\reentrant
void scale(int w, int h, Qt::AspectRatioMode mode) noexcept
Scales the size to a rectangle with the given width and height, according to the specified mode:
constexpr bool isNull() const noexcept
Returns true if both the width and height is 0; otherwise returns false.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString & append(QChar c)
QHash< int, QPixmap > * addedPixmaps
bool tryLoad(QSvgRenderer *renderer, QIcon::Mode mode, QIcon::State state)
QHash< int, QString > svgFiles
static int hashKey(QIcon::Mode mode, QIcon::State state)
QHash< int, QByteArray > * svgBuffers
static QAtomicInt lastSerialNum
QString pmcKey(const QSize &size, QIcon::Mode mode, QIcon::State state)
QIcon::Mode loadDataForModeAndState(QSvgRenderer *renderer, QIcon::Mode mode, QIcon::State state)
QIconEngine * clone() const override
Reimplement this method to return a clone of this icon engine.
QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override
Returns the icon as a pixmap with the required size, mode, and state.
void virtual_hook(int id, void *data) override
bool read(QDataStream &in) override
Reads icon engine contents from the QDataStream in.
bool write(QDataStream &out) const override
Writes the contents of this engine to the QDataStream out.
void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state) override
Called by QIcon::addFile().
QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) override
Returns the actual size of the icon the engine provides for the requested size, mode and state.
void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state) override
Called by QIcon::addPixmap().
void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override
Uses the given painter to paint the icon with the required mode and state into the rectangle rect.
QString key() const override
\variable QIconEngine::ScaledPixmapArgument::size
void render(QPainter *p)
Renders the current document, or the current frame of an animated document, using the given painter.
QSize defaultSize() const
Returns the default size of the document contents.
bool isValid() const
Returns true if there is a valid current document; otherwise returns false.
bool load(const QString &filename)
Loads the SVG file specified by filename, returning true if the content was successfully parsed; othe...
QSet< QString >::iterator it
Combined button and popup list for selecting options.
QByteArray qCompress(const uchar *data, qsizetype nbytes, int compressionLevel)
Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, qsizetype nbytes)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
QLatin1StringView QLatin1String
static QByteArray maybeUncompress(const QByteArray &ba)
static FileType fileType(const QFileInfo &fi)
QFileInfo fi("c:/temp/foo")
[newstuff]
QTextStream out(stdout)
[7]
QSvgRenderer * renderer
[0]
\inmodule QtCore \reentrant