7#include <QtCore/qmath.h>
8#include <QtQuick/private/qquickimagebase_p_p.h>
40 if (
size.width() <= 0)
42 if (
size.height() <= 0)
43 size.setHeight(
q->height());
53 }
else if (
source.isEmpty()) {
55 if (iconEngine && !iconEngine->isNull()) {
86 if (pixmapSize.width() >
q->width() || pixmapSize.height() >
q->height())
97 return q->window() ?
q->window()->effectiveDevicePixelRatio() :
qApp->devicePixelRatio();
109 return d->icon.iconName;
115 if (
d->icon.iconName ==
name)
118 d->icon.entries.clear();
120 if (
d->icon.iconName.isEmpty())
121 d->icon.iconName =
name;
188 if (!
d->updatingFillMode &&
d->color.alpha() > 0) {
190 if (!
image.isNull()) {
194 d->currentPix->setImage(
image);
201#include "moc_qquickiconimage_p.cpp"
The QColor class provides colors based on RGB, HSV or CMYK values.
static Q_GUI_EXPORT QIconLoaderEngineEntry * entryForSize(const QThemeIconInfo &info, const QSize &size, int scale=1)
static QIconLoader * instance()
Mode
This enum type describes the mode for which a pixmap is intended to be used.
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
The QPainter class performs low-level painting on widgets and other paint devices.
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
@ CompositionMode_SourceIn
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
The QQmlContext class defines a context within a QML engine.
virtual void componentComplete()=0
Invoked after the root component that caused this instantiation has completed construction.
qreal calculateDevicePixelRatio() const
bool updateDevicePixelRatio(qreal targetDevicePixelRatio) override
~QQuickIconImagePrivate() override
void setName(const QString &name)
void pixmapChange() override
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void setColor(const QColor &color)
void setSource(const QUrl &url) override
QQuickIconImage(QQuickItem *parent=nullptr)
QQuickPixmap * currentPix
virtual bool updateDevicePixelRatio(qreal targetDevicePixelRatio)
void itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
void sourceChanged(const QUrl &)
void setImage(const QImage &img)
void setFillMode(FillMode)
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void pixmapChange() override
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
@ ItemDevicePixelRatioHasChanged
\inmodule QtCore\reentrant
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLsizei GLchar * source
GLdouble GLdouble GLdouble GLdouble q
QQmlContext * qmlContext(const QObject *obj)
static QT_BEGIN_NAMESPACE qreal dpr(const QWindow *w)
QThemeIconEntries entries