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>
137 emit q->topInsetChanged();
149 emit q->leftInsetChanged();
161 emit q->rightInsetChanged();
173 emit q->bottomInsetChanged();
193 || (
extra.isAllocated() && (
extra->hasLeftInset ||
extra->hasRightInset))) {
200 || (
extra.isAllocated() && (
extra->hasTopInset ||
extra->hasBottomInset))) {
243 q->QQuickTextEdit::setFont(
font);
248 emit q->fontChanged();
251#if QT_CONFIG(quicktemplates2_hover)
252void QQuickTextAreaPrivate::updateHoverEnabled(
bool enabled,
bool xplicit)
255 if (!xplicit && explicitHoverEnabled)
258 bool wasEnabled =
q->isHoverEnabled();
259 explicitHoverEnabled = xplicit;
262 QQuickControlPrivate::updateHoverEnabledRecur(
q,
enabled);
263 emit q->hoverEnabledChanged();
294 q->setParentItem(
nullptr);
325 const qreal tp =
q->topPadding();
326 const qreal lp =
q->leftPadding();
327 const QRectF cr =
q->cursorRectangle();
329 if (cr.
left() <= cx + lp) {
334 const qreal rp =
q->rightPadding();
335 const QRectF nr =
q->cursorPosition() <
q->length() ?
q->positionToRectangle(
q->cursorPosition() + 1) :
QRectF();
338 else if (cr.
right() >= cx + lp +
w - rp)
342 if (cr.
top() <= cy + tp) {
345 const qreal bp =
q->bottomPadding();
382 extra.value().hasBackgroundWidth =
p->widthValid();
384 extra.value().hasBackgroundHeight =
p->heightValid();
407 emit q->implicitWidthChanged3();
414 emit q->implicitHeightChanged3();
417#if QT_CONFIG(accessibility)
418void QQuickTextAreaPrivate::accessibilityActiveChanged(
bool active)
420 QQuickTextEditPrivate::accessibilityActiveChanged(active);
421 if (QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(q_func()))
448 emit q->implicitBackgroundWidthChanged();
455 emit q->implicitBackgroundHeightChanged();
463 emit q->implicitBackgroundWidthChanged();
464 emit q->implicitBackgroundHeightChanged();
481 d->setImplicitResizeEnabled(
false);
482 d->pressHandler.control =
this;
484#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
486 QQuickTextEdit::setOldSelectionDefault();
494 d->detachFlickable();
515 if (
d->extra.value().requestedFont.resolveMask() ==
font.
resolveMask() &&
d->extra.value().requestedFont ==
font)
518 d->extra.value().requestedFont =
font;
536 return d->background;
547 if (!
d->background.isExecuting())
548 d->cancelBackground();
553 if (
d->extra.isAllocated()) {
554 d->extra.value().hasBackgroundWidth =
false;
555 d->extra.value().hasBackgroundHeight =
false;
564 if (
p->widthValid() ||
p->heightValid()) {
565 d->extra.value().hasBackgroundWidth =
p->widthValid();
566 d->extra.value().hasBackgroundHeight =
p->heightValid();
575 d->resizeBackground();
580 emit implicitBackgroundWidthChanged();
582 emit implicitBackgroundHeightChanged();
583 if (!
d->background.isExecuting())
596 return d->placeholder;
602 if (
d->placeholder ==
text)
605 d->placeholder =
text;
606#if QT_CONFIG(accessibility)
608 accessibleAttached->setDescription(
text);
624 return d->placeholderColor;
630 if (
d->placeholderColor ==
color)
633 d->placeholderColor =
color;
634 emit placeholderTextColorChanged();
659 return d->lastFocusChangeReason();
665 d->setLastFocusChangeReason(reason);
673 if (
d->flickable && !
d->flickable->contains(
d->flickable->mapFromItem(
this, point)))
689#if QT_CONFIG(quicktemplates2_hover)
699#if QT_CONFIG(quicktemplates2_hover)
705 emit hoveredChanged();
721#if QT_CONFIG(quicktemplates2_hover)
723 return d->hoverEnabled;
731#if QT_CONFIG(quicktemplates2_hover)
733 if (
d->explicitHoverEnabled &&
enabled ==
d->hoverEnabled)
736 d->updateHoverEnabled(
enabled,
true);
744#if QT_CONFIG(quicktemplates2_hover)
746 if (!
d->explicitHoverEnabled)
749 d->explicitHoverEnabled =
false;
750 d->updateHoverEnabled(QQuickControlPrivate::calcHoverEnabled(
d->parentItem),
false);
770 return d->background->implicitWidth();
789 return d->background->implicitHeight();
803 return d->getTopInset();
809 d->setTopInset(inset);
815 d->setTopInset(0,
true);
829 return d->getLeftInset();
835 d->setLeftInset(inset);
841 d->setLeftInset(0,
true);
855 return d->getRightInset();
861 d->setRightInset(inset);
867 d->setRightInset(0,
true);
881 return d->getBottomInset();
887 d->setBottomInset(inset);
893 d->setBottomInset(0,
true);
906 d->executeBackground(
true);
908 d->resizeBackground();
909#if QT_CONFIG(quicktemplates2_hover)
910 if (!
d->explicitHoverEnabled)
926#if QT_CONFIG(quicktemplates2_hover)
927 if (!
d->explicitHoverEnabled)
928 d->updateHoverEnabled(QQuickControlPrivate::calcHoverEnabled(
d->parentItem),
false);
935 d->attachFlickable(flickable);
949 d->resizeBackground();
957 d->resizeBackground();
969 clipper =
d->flickable;
976 clipNode->
setRect(!
d->flickable ? cr : cr.
translated(
d->flickable->contentX(),
d->flickable->contentY()));
986 cursorNode->
setClipRect(
d->cursorItem->mapRectFromItem(clipper, cr));
1002#if QT_CONFIG(quicktemplates2_hover)
1022 d->pressHandler.mousePressEvent(
event);
1023 if (
d->pressHandler.isActive()) {
1024 if (
d->pressHandler.delayedMousePressEvent) {
1026 d->pressHandler.clearDelayedMouseEvent();
1030 const bool wasAccepted =
event->isAccepted();
1040 d->pressHandler.mouseMoveEvent(
event);
1041 if (
d->pressHandler.isActive()) {
1042 if (
d->pressHandler.delayedMousePressEvent) {
1044 d->pressHandler.clearDelayedMouseEvent();
1053 d->pressHandler.mouseReleaseEvent(
event);
1054 if (
d->pressHandler.isActive()) {
1055 if (
d->pressHandler.delayedMousePressEvent) {
1057 d->pressHandler.clearDelayedMouseEvent();
1066 if (
d->pressHandler.delayedMousePressEvent) {
1068 d->pressHandler.clearDelayedMouseEvent();
1076 if (
event->timerId() ==
d->pressHandler.timer.timerId())
1077 d->pressHandler.timerEvent(
event);
1115 if (
d->control == control)
1121 d->control = control;
1131#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.
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
virtual void implicitHeightChanged()
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
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.
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 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 itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
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
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
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()