9#include <QtGui/private/qguiapplication_p.h>
10#include <QtQuick/private/qquickitem_p.h>
11#include <QtQuick/private/qquicktext_p.h>
18 parserStatus->classBegin();
24 parserStatus->componentComplete();
174 const qreal iconImplicitWidth = showIcon ?
image->implicitWidth() : 0;
175 const qreal iconImplicitHeight = showIcon ?
image->implicitHeight() : 0;
176 const qreal textImplicitWidth = showText ?
label->implicitWidth() : 0;
177 const qreal textImplicitHeight = showText ?
label->implicitHeight() : 0;
178 const qreal effectiveSpacing = showText && showIcon &&
image->implicitWidth() > 0 ?
spacing : 0;
180 :
qMax(iconImplicitWidth, textImplicitWidth);
182 :
qMax(iconImplicitHeight, textImplicitHeight);
195 y += rectangle.
height() / 2 -
h / 2;
201 x += rectangle.
width() / 2 -
w / 2;
219 qMin(
image->implicitHeight(), availableHeight)),
229 qMin(
label->implicitHeight(), availableHeight)),
244 qreal effectiveSpacing = 0;
278 qreal effectiveSpacing = 0;
353 d->unwatchChanges(
d->image);
355 d->unwatchChanges(
d->label);
371 d->icon.ensureRelativeSourceResolved(
this);
372 d->updateOrSyncImage();
388 d->updateOrSyncLabel();
405 d->label->setFont(
font);
422 d->label->setColor(
color);
440 d->updateImplicitSize();
457 if (
d->image &&
d->label) {
458 d->updateImplicitSize();
491 if (
d->alignment == align)
494 d->alignment =
static_cast<Qt::Alignment
>(align);
509 return d->topPadding;
518 d->topPadding = padding;
519 d->updateImplicitSize();
531 return d->leftPadding;
540 d->leftPadding = padding;
541 d->updateImplicitSize();
553 return d->rightPadding;
562 d->rightPadding = padding;
563 d->updateImplicitSize();
575 return d->bottomPadding;
584 d->bottomPadding = padding;
585 d->updateImplicitSize();
614#include "moc_qquickiconlabel_p.cpp"
The QColor class provides colors based on RGB, HSV or CMYK values.
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
static void setContextForObject(QObject *, QQmlContext *)
Sets the QQmlContext for the object to context.
The QQmlParserStatus class provides updates on the QML parser state.
void watchChanges(QQuickItem *item)
void unwatchChanges(QQuickItem *item)
void itemImplicitWidthChanged(QQuickItem *) override
~QQuickIconLabelPrivate() override
void itemImplicitHeightChanged(QQuickItem *) override
void updateImplicitSize()
QQuickMnemonicLabel * label
void itemDestroyed(QQuickItem *item) override
void setBottomPadding(qreal padding)
void setAlignment(Qt::Alignment alignment)
void setColor(const QColor &color)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void setRightPadding(qreal padding)
void setMirrored(bool mirrored)
void setText(const QString &text)
void setLeftPadding(qreal padding)
void setSpacing(qreal spacing)
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
QQuickIconLabel(QQuickItem *parent=nullptr)
void setFont(const QFont &font)
void setTopPadding(qreal padding)
void setDisplay(Display display)
void resetBottomPadding()
void setIcon(const QQuickIcon &icon)
QUrl resolvedSource() const
void removeItemChangeListener(QQuickItemChangeListener *, ChangeTypes types)
void addItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types)
quint32 componentComplete
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
void componentComplete() override
\reimp Derived classes should call the base class method before adding their own actions to perform a...
\inmodule QtCore\reentrant
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr void setHeight(qreal h) noexcept
Sets the height to the given finite height.
constexpr void setWidth(qreal w) noexcept
Sets the width to the given finite width.
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
struct wl_display * display
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLsizei const GLchar * label
[43]
GLfloat GLfloat GLfloat GLfloat h
GLdouble GLdouble GLdouble GLdouble q
QQmlContext * qmlContext(const QObject *obj)
static void completeComponent(QQuickItem *item)
static QT_BEGIN_NAMESPACE void beginClass(QQuickItem *item)
static const QQuickItemPrivate::ChangeTypes itemChangeTypes
static QRectF alignedRect(bool mirrored, Qt::Alignment alignment, const QSizeF &size, const QRectF &rectangle)
#define QStringLiteral(str)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent