10#include <QtQuick/private/qquickitem_p.h>
11#include <QtQuick/private/qquicktext_p.h>
13#if QT_CONFIG(accessibility)
14#include <QtQuick/private/qquickaccessibleattached_p.h>
51#if QT_CONFIG(accessibility)
52 QAccessible::installActivationObserver(
this);
58#if QT_CONFIG(accessibility)
59 QAccessible::removeActivationObserver(
this);
70 emit q->topInsetChanged();
82 emit q->leftInsetChanged();
94 emit q->rightInsetChanged();
106 emit q->bottomInsetChanged();
120 || (
extra.isAllocated() && (
extra->hasLeftInset ||
extra->hasRightInset))) {
125 || (
extra.isAllocated() && (
extra->hasTopInset ||
extra->hasBottomInset))) {
167 q->QQuickText::setFont(
font);
172 emit q->fontChanged();
177#if QT_CONFIG(accessibility)
178 maybeSetAccessibleName(
text);
184#if QT_CONFIG(accessibility)
185void QQuickLabelPrivate::accessibilityActiveChanged(
bool active)
191 QQuickAccessibleAttached *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(qmlAttachedPropertiesObject<QQuickAccessibleAttached>(
q,
true));
193 accessibleAttached->setRole(effectiveAccessibleRole());
194 maybeSetAccessibleName(
text);
197QAccessible::Role QQuickLabelPrivate::accessibleRole()
const
199 return QAccessible::StaticText;
202void QQuickLabelPrivate::maybeSetAccessibleName(
const QString &
name)
205 auto accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(
206 qmlAttachedPropertiesObject<QQuickAccessibleAttached>(
q,
true));
207 if (accessibleAttached) {
208 if (!accessibleAttached->wasNameExplicitlySet())
209 accessibleAttached->setNameImplicitly(
name);
239 extra.value().hasBackgroundWidth =
p->widthValid();
240 extra.value().hasBackgroundHeight =
p->heightValid();
248 emit q->implicitBackgroundWidthChanged();
255 emit q->implicitBackgroundHeightChanged();
263 emit q->implicitBackgroundWidthChanged();
264 emit q->implicitBackgroundHeightChanged();
298 if (
d->extra.value().requestedFont.resolveMask() ==
font.
resolveMask() &&
d->extra.value().requestedFont ==
font)
301 d->extra.value().requestedFont =
font;
321 return d->background;
330 if (!
d->background.isExecuting())
331 d->cancelBackground();
336 if (
d->extra.isAllocated()) {
337 d->extra.value().hasBackgroundWidth =
false;
338 d->extra.value().hasBackgroundHeight =
false;
350 if (
p->widthValid() ||
p->heightValid()) {
351 d->extra.value().hasBackgroundWidth =
p->widthValid();
352 d->extra.value().hasBackgroundHeight =
p->heightValid();
355 d->resizeBackground();
360 emit implicitBackgroundWidthChanged();
362 emit implicitBackgroundHeightChanged();
363 if (!
d->background.isExecuting())
383 return d->background->implicitWidth();
402 return d->background->implicitHeight();
416 return d->getTopInset();
422 d->setTopInset(inset);
428 d->setTopInset(0,
true);
442 return d->getLeftInset();
448 d->setLeftInset(inset);
454 d->setLeftInset(0,
true);
468 return d->getRightInset();
474 d->setRightInset(inset);
480 d->setRightInset(0,
true);
494 return d->getBottomInset();
500 d->setBottomInset(inset);
506 d->setBottomInset(0,
true);
519 d->executeBackground(
true);
521 d->resizeBackground();
522#if QT_CONFIG(accessibility)
523 if (QAccessible::isActive())
524 d->accessibilityActiveChanged(
true);
550 d->resizeBackground();
558 d->resizeBackground();
563#include "moc_qquicklabel_p.cpp"
QFont resolve(const QFont &) const
Returns a new QFont that has attributes copied from other that have not been previously set on this f...
void setResolveMask(uint mask)
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 QPalette class contains color groups for each widget state.
virtual void classBegin()=0
Invoked after class creation, but before any properties have been set.
void removeImplicitSizeListener(QQuickItem *item, ChangeTypes changes=ImplicitSizeChanges)
static const ChangeTypes ImplicitSizeChanges
Abstract base type providing functionality common to all controls.
void addImplicitSizeListener(QQuickItem *item, ChangeTypes changes=ImplicitSizeChanges)
static void hideOldItem(QQuickItem *item)
static QFont parentFont(const QQuickItem *item)
static void updateFontRecur(QQuickItem *item, const QFont &font)
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
qreal x
\qmlproperty real QtQuick::Item::x \qmlproperty real QtQuick::Item::y \qmlproperty real QtQuick::Item...
void setParentItem(QQuickItem *parent)
qreal z
\qmlproperty real QtQuick::Item::z
qreal y
Defines the item's y position relative to its parent.
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.
void itemDestroyed(QQuickItem *item) override
QQuickLabelPrivate()
Styled text label with inherited font.
void setBottomInset(qreal value, bool reset=false)
void textChanged(const QString &text)
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
void inheritFont(const QFont &font)
void itemImplicitWidthChanged(QQuickItem *item) override
QMarginsF getInset() const
qreal getLeftInset() const
void updateFont(const QFont &font)
qreal getBottomInset() const
void setFont_helper(const QFont &font)
qreal getTopInset() const
void setLeftInset(qreal value, bool reset=false)
void itemImplicitHeightChanged(QQuickItem *item) override
qreal getRightInset() const
void executeBackground(bool complete=false)
QLazilyAllocated< ExtraData > extra
QQuickDeferredPointer< QQuickItem > background
QPalette defaultPalette() const override
void setTopInset(qreal value, bool reset=false)
void setRightInset(qreal value, bool reset=false)
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void setFont(const QFont &font)
void setTopInset(qreal inset)
void componentComplete() override
\reimp Derived classes should call the base class method before adding their own actions to perform a...
void itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
qreal implicitBackgroundWidth
qreal implicitBackgroundHeight
void setLeftInset(qreal inset)
virtual void insetChange(const QMarginsF &newInset, const QMarginsF &oldInset)
void setRightInset(qreal inset)
void setBottomInset(qreal inset)
void classBegin() override
\reimp Derived classes should call the base class method before adding their own action to perform at...
QQuickLabel(QQuickItem *parent=nullptr)
void setBackground(QQuickItem *background)
void textChanged(const QString &text)
void componentComplete() override
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
static QPalette palette(Scope scope)
static QFont font(Scope scope)
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble GLdouble q
void quickCancelDeferred(QObject *object, const QString &property)
void quickCompleteDeferred(QObject *object, const QString &property, QQuickDeferredPointer< T > &delegate)
void quickBeginDeferred(QObject *object, const QString &property, QQuickDeferredPointer< T > &delegate)
static QString backgroundName()