11#include <QtQml/qqmlinfo.h>
12#include <QtQuick/private/qquickitem_p.h>
13#include <QtQuick/private/qquickclipnode_p.h>
14#include <QtQuick/private/qquickflickable_p.h>
16#if QT_CONFIG(accessibility)
17#include <QtQuick/private/qquickaccessibleattached_p.h>
124#if QT_CONFIG(accessibility)
125 QAccessible::installActivationObserver(
this);
131#if QT_CONFIG(accessibility)
132 QAccessible::removeActivationObserver(
this);
143 emit q->topInsetChanged();
155 emit q->leftInsetChanged();
167 emit q->rightInsetChanged();
179 emit q->bottomInsetChanged();
199 || (
extra.isAllocated() && (
extra->hasLeftInset ||
extra->hasRightInset))) {
206 || (
extra.isAllocated() && (
extra->hasTopInset ||
extra->hasBottomInset))) {
249 q->QQuickTextEdit::setFont(
font);
254 emit q->fontChanged();
257#if QT_CONFIG(quicktemplates2_hover)
258void QQuickTextAreaPrivate::updateHoverEnabled(
bool enabled,
bool xplicit)
261 if (!xplicit && explicitHoverEnabled)
264 bool wasEnabled =
q->isHoverEnabled();
265 explicitHoverEnabled = xplicit;
268 QQuickControlPrivate::updateHoverEnabledRecur(
q,
enabled);
269 emit q->hoverEnabledChanged();
300 q->setParentItem(
nullptr);
331 const qreal tp =
q->topPadding();
332 const qreal lp =
q->leftPadding();
333 const QRectF cr =
q->cursorRectangle();
335 if (cr.
left() <= cx + lp) {
340 const qreal rp =
q->rightPadding();
341 const QRectF nr =
q->cursorPosition() <
q->length() ?
q->positionToRectangle(
q->cursorPosition() + 1) :
QRectF();
344 else if (cr.
right() >= cx + lp +
w - rp)
348 if (cr.
top() <= cy + tp) {
351 const qreal bp =
q->bottomPadding();
388 extra.value().hasBackgroundWidth =
p->widthValid();
390 extra.value().hasBackgroundHeight =
p->heightValid();
413 emit q->implicitWidthChanged3();
420 emit q->implicitHeightChanged3();
426#if QT_CONFIG(accessibility)
427 if (QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(q_func()))
428 accessibleAttached->set_readOnly(isReadOnly);
432#if QT_CONFIG(accessibility)
433void QQuickTextAreaPrivate::accessibilityActiveChanged(
bool active)
439 QQuickAccessibleAttached *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(qmlAttachedPropertiesObject<QQuickAccessibleAttached>(
q,
true));
441 accessibleAttached->setRole(effectiveAccessibleRole());
442 accessibleAttached->set_readOnly(
q->isReadOnly());
446QAccessible::Role QQuickTextAreaPrivate::accessibleRole()
const
448 return QAccessible::EditableText;
474 emit q->implicitBackgroundWidthChanged();
481 emit q->implicitBackgroundHeightChanged();
489 emit q->implicitBackgroundWidthChanged();
490 emit q->implicitBackgroundHeightChanged();
507 d->setImplicitResizeEnabled(
false);
508 d->pressHandler.control =
this;
512#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
514 QQuickTextEdit::setOldSelectionDefault();
522 d->detachFlickable();
543 if (
d->extra.value().requestedFont.resolveMask() ==
font.
resolveMask() &&
d->extra.value().requestedFont ==
font)
546 d->extra.value().requestedFont =
font;
563 d->executeBackground();
564 return d->background;
575 if (!
d->background.isExecuting())
576 d->cancelBackground();
581 if (
d->extra.isAllocated()) {
582 d->extra.value().hasBackgroundWidth =
false;
583 d->extra.value().hasBackgroundHeight =
false;
592 if (
p->widthValid() ||
p->heightValid()) {
593 d->extra.value().hasBackgroundWidth =
p->widthValid();
594 d->extra.value().hasBackgroundHeight =
p->heightValid();
603 d->resizeBackground();
608 emit implicitBackgroundWidthChanged();
610 emit implicitBackgroundHeightChanged();
611 if (!
d->background.isExecuting())
624 return d->placeholder;
630 if (
d->placeholder ==
text)
633 d->placeholder =
text;
634#if QT_CONFIG(accessibility)
636 accessibleAttached->setDescription(
text);
652 return d->placeholderColor;
658 if (
d->placeholderColor ==
color)
661 d->placeholderColor =
color;
662 emit placeholderTextColorChanged();
673 return d->focusReason;
679 if (
d->focusReason == reason)
682 d->focusReason = reason;
689 if (
d->flickable && !
d->flickable->contains(
d->flickable->mapFromItem(
this, point)))
705#if QT_CONFIG(quicktemplates2_hover)
715#if QT_CONFIG(quicktemplates2_hover)
721 emit hoveredChanged();
737#if QT_CONFIG(quicktemplates2_hover)
739 return d->hoverEnabled;
747#if QT_CONFIG(quicktemplates2_hover)
749 if (
d->explicitHoverEnabled &&
enabled ==
d->hoverEnabled)
752 d->updateHoverEnabled(
enabled,
true);
760#if QT_CONFIG(quicktemplates2_hover)
762 if (!
d->explicitHoverEnabled)
765 d->explicitHoverEnabled =
false;
766 d->updateHoverEnabled(QQuickControlPrivate::calcHoverEnabled(
d->parentItem),
false);
786 return d->background->implicitWidth();
805 return d->background->implicitHeight();
819 return d->getTopInset();
825 d->setTopInset(inset);
831 d->setTopInset(0,
true);
845 return d->getLeftInset();
851 d->setLeftInset(inset);
857 d->setLeftInset(0,
true);
871 return d->getRightInset();
877 d->setRightInset(inset);
883 d->setRightInset(0,
true);
897 return d->getBottomInset();
903 d->setBottomInset(inset);
909 d->setBottomInset(0,
true);
922 d->executeBackground(
true);
924 d->resizeBackground();
925#if QT_CONFIG(quicktemplates2_hover)
926 if (!
d->explicitHoverEnabled)
929#if QT_CONFIG(accessibility)
930 if (QAccessible::isActive())
931 d->accessibilityActiveChanged(
true);
946#if QT_CONFIG(quicktemplates2_hover)
947 if (!
d->explicitHoverEnabled)
948 d->updateHoverEnabled(QQuickControlPrivate::calcHoverEnabled(
d->parentItem),
false);
955 d->attachFlickable(flickable);
969 d->resizeBackground();
977 d->resizeBackground();
989 clipper =
d->flickable;
996 clipNode->
setRect(!
d->flickable ? cr : cr.
translated(
d->flickable->contentX(),
d->flickable->contentY()));
1003 if (
d->cursorItem) {
1006 cursorNode->
setClipRect(
d->cursorItem->mapRectFromItem(clipper, cr));
1024#if QT_CONFIG(quicktemplates2_hover)
1044 d->pressHandler.mousePressEvent(
event);
1045 if (
d->pressHandler.isActive()) {
1046 if (
d->pressHandler.delayedMousePressEvent) {
1048 d->pressHandler.clearDelayedMouseEvent();
1052 const bool wasAccepted =
event->isAccepted();
1062 d->pressHandler.mouseMoveEvent(
event);
1063 if (
d->pressHandler.isActive()) {
1064 if (
d->pressHandler.delayedMousePressEvent) {
1066 d->pressHandler.clearDelayedMouseEvent();
1075 d->pressHandler.mouseReleaseEvent(
event);
1076 if (
d->pressHandler.isActive()) {
1077 if (
d->pressHandler.delayedMousePressEvent) {
1079 d->pressHandler.clearDelayedMouseEvent();
1088 if (
d->pressHandler.delayedMousePressEvent) {
1090 d->pressHandler.clearDelayedMouseEvent();
1098 if (
event->timerId() ==
d->pressHandler.timer.timerId())
1099 d->pressHandler.timerEvent(
event);
1137 if (
d->control == control)
1143 d->control = control;
1153#include "moc_qquicktextarea_p.cpp"
The QColor class provides colors based on RGB, HSV or CMYK values.
The QFocusEvent class contains event parameters for widget focus events.
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)
void setParentItem(QGraphicsItem *parent)
Sets this item's parent item to newParent.
constexpr qreal right() const noexcept
Returns the right margin.
constexpr qreal left() const noexcept
Returns the left margin.
constexpr qreal top() const noexcept
Returns the top margin.
constexpr qreal bottom() const noexcept
Returns the bottom margin.
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)
static bool disconnect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
virtual void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object.
The QPalette class contains color groups for each widget state.
\inmodule QtCore\reentrant
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 warnIfCustomizationNotSupported(QObject *control, QQuickItem *item, const QString &propertyName)
static void updateFontRecur(QQuickItem *item, const QFont &font)
void setRect(const QRectF &)
void setContentWidth(qreal)
virtual void setContentX(qreal pos)
void contentWidthChanged()
virtual void setContentY(qreal pos)
void contentHeightChanged()
void setContentHeight(qreal)
bool heightChange() const
void updateOrRemoveGeometryChangeListener(QQuickItemChangeListener *listener, QQuickGeometryChange types)
void updateOrAddGeometryChangeListener(QQuickItemChangeListener *listener, QQuickGeometryChange types)
QQuickDefaultClipNode * clipNode() const
void removeItemChangeListener(QQuickItemChangeListener *, ChangeTypes types)
virtual void implicitHeightChanged()
void addItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types)
virtual qreal getImplicitWidth() const
virtual qreal getImplicitHeight() const
static QQuickItemPrivate * get(QQuickItem *item)
virtual void implicitWidthChanged()
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
virtual void hoverEnterEvent(QHoverEvent *event)
This event handler can be reimplemented in a subclass to receive hover-enter events for an item.
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
void setAcceptHoverEvents(bool enabled)
If enabled is true, this sets the item to accept hover events; otherwise, hover events are not accept...
qreal y
Defines the item's y position relative to its parent.
virtual Q_INVOKABLE bool contains(const QPointF &point) const
\qmlmethod bool QtQuick::Item::contains(point point)
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
Sets the mouse buttons accepted by this item to buttons.
qreal width
This property holds the width of this item.
QQuickItem * parentItem() const
virtual void itemChange(ItemChange, const ItemChangeData &)
Called when change occurs for this item.
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
qreal height
This property holds the height of this item.
virtual QRectF clipRect() const
Returns the rectangular area within this item that is currently visible in \l viewportItem(),...
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
friend class QQuickAccessibleAttached
virtual void hoverLeaveEvent(QHoverEvent *event)
This event handler can be reimplemented in a subclass to receive hover-leave events for an item.
void update()
Schedules a call to updatePaintNode() for this item.
void setActiveFocusOnTab(bool)
void setFlickable(QQuickTextArea *control)
QQuickTextArea * flickable
QQuickTextAreaAttached(QObject *parent)
void readOnlyChanged(bool isReadOnly)
void implicitWidthChanged() override
qreal getImplicitWidth() const override
void setFont_helper(const QFont &font)
QQuickFlickable * flickable
QQuickDeferredPointer< QQuickItem > background
void setTopInset(qreal value, bool reset=false)
void setLeftInset(qreal value, bool reset=false)
void setRightInset(qreal value, bool reset=false)
void executeBackground(bool complete=false)
QLazilyAllocated< ExtraData > extra
void updateFont(const QFont &font)
qreal getLeftInset() const
qreal getTopInset() const
void setBottomInset(qreal value, bool reset=false)
void itemDestroyed(QQuickItem *item) override
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
void itemImplicitWidthChanged(QQuickItem *item) override
void attachFlickable(QQuickFlickable *flickable)
void resizeFlickableControl()
void inheritFont(const QFont &font)
qreal getImplicitHeight() const override
void ensureCursorVisible()
void itemImplicitHeightChanged(QQuickItem *item) override
void resizeFlickableContent()
QMarginsF getInset() const
static QQuickTextAreaPrivate * get(QQuickTextArea *item)
qreal getRightInset() const
QPalette defaultPalette() const override
qreal getBottomInset() const
void implicitHeightChanged() override
QQuickTextAreaPrivate()
Multi-line text input area.
void setTopInset(qreal inset)
void focusOutEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive focus-out events for an item.
void placeholderTextChanged()
Qt::FocusReason focusReason
void componentComplete() override
\reimp Derived classes should call the base class method before adding their own actions to perform a...
void setRightInset(qreal inset)
void setHoverEnabled(bool enabled)
virtual void insetChange(const QMarginsF &newInset, const QMarginsF &oldInset)
void itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
QColor placeholderTextColor
void setBackground(QQuickItem *background)
qreal implicitBackgroundWidth
void setLeftInset(qreal inset)
void setHovered(bool hovered)
void focusInEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive focus-in events for an item.
void setBottomInset(qreal inset)
void classBegin() override
\reimp Derived classes should call the base class method before adding their own action to perform at...
void setFocusReason(Qt::FocusReason reason)
void mouseMoveEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse move events for an item.
void mousePressEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
QSGNode * updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override
Called on the render thread when it is time to sync the state of the item with the scene graph.
void setPlaceholderText(const QString &text)
bool contains(const QPointF &point) const override
\qmlmethod bool QtQuick::Item::contains(point point)
qreal implicitBackgroundHeight
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
QQuickTextArea(QQuickItem *parent=nullptr)
void focusReasonChanged()
bool isHoverEnabled() const
void setPlaceholderTextColor(const QColor &color)
void setFont(const QFont &font)
void mouseReleaseEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse release events for an item.
static QQuickTextAreaAttached * qmlAttachedProperties(QObject *object)
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void mouseDoubleClickEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse double-click events for an ite...
QQuickTextEdit::WrapMode wrapMode
void focusInEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive focus-in events for an item.
void mouseMoveEvent(QMouseEvent *event) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void componentComplete() override
Ensures any delayed caching or data loading the class needs to performed is complete.
void hoverLeaveEvent(QHoverEvent *event) override
This event handler can be reimplemented in a subclass to receive hover-leave events for an item.
void contentSizeChanged()
QSGNode * updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) override
Called on the render thread when it is time to sync the state of the item with the scene graph.
void mouseReleaseEvent(QMouseEvent *event) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void mouseDoubleClickEvent(QMouseEvent *event) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void readOnlyChanged(bool isReadOnly)
void mousePressEvent(QMouseEvent *event) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void hoverEnterEvent(QHoverEvent *event) override
This event handler can be reimplemented in a subclass to receive hover-enter events for an item.
void focusOutEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive focus-out events for an item.
void cursorRectangleChanged()
HAlignment effectiveHAlign() const
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
static QPalette palette(Scope scope)
static QFont font(Scope scope)
\inmodule QtCore\reentrant
constexpr qreal bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr QRectF translated(qreal dx, qreal dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr qreal top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
void setClipRect(const QRectF &)
Sets the clip rect of this clip node to rect.
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
void appendChildNode(QSGNode *node)
Appends node to this node's list of children.
QSGNode * parent() const
Returns the parent node of this node.
QSGNode * firstChild() const
Returns the first child of this node.
\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
constexpr const T & qMax(const T &a, const T &b)
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat GLfloat GLfloat h
GLdouble GLdouble GLdouble GLdouble q
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
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)
#define QStringLiteral(str)
QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
static QString backgroundName()
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent