Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquicktextfield.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qquicktextfield_p.h"
6#include "qquickcontrol_p.h"
7#include "qquickcontrol_p_p.h"
9
10#include <QtQuick/private/qquickitem_p.h>
11#include <QtQuick/private/qquicktextinput_p.h>
12#include <QtQuick/private/qquickclipnode_p.h>
13
14#if QT_CONFIG(accessibility)
15#include <QtQuick/private/qquickaccessibleattached_p.h>
16#endif
17
19
20using namespace Qt::StringLiterals;
21
26
87{
88#if QT_CONFIG(accessibility)
89 QAccessible::installActivationObserver(this);
90#endif
91}
92
94{
95#if QT_CONFIG(accessibility)
96 QAccessible::removeActivationObserver(this);
97#endif
98}
99
101{
102 Q_Q(QQuickTextField);
103 const QMarginsF oldInset = getInset();
104 extra.value().topInset = value;
105 extra.value().hasTopInset = !reset;
106 if (!qFuzzyCompare(oldInset.top(), value)) {
107 emit q->topInsetChanged();
108 q->insetChange(getInset(), oldInset);
109 }
110}
111
113{
114 Q_Q(QQuickTextField);
115 const QMarginsF oldInset = getInset();
116 extra.value().leftInset = value;
117 extra.value().hasLeftInset = !reset;
118 if (!qFuzzyCompare(oldInset.left(), value)) {
119 emit q->leftInsetChanged();
120 q->insetChange(getInset(), oldInset);
121 }
122}
123
125{
126 Q_Q(QQuickTextField);
127 const QMarginsF oldInset = getInset();
128 extra.value().rightInset = value;
129 extra.value().hasRightInset = !reset;
130 if (!qFuzzyCompare(oldInset.right(), value)) {
131 emit q->rightInsetChanged();
132 q->insetChange(getInset(), oldInset);
133 }
134}
135
137{
138 Q_Q(QQuickTextField);
139 const QMarginsF oldInset = getInset();
140 extra.value().bottomInset = value;
141 extra.value().hasBottomInset = !reset;
142 if (!qFuzzyCompare(oldInset.bottom(), value)) {
143 emit q->bottomInsetChanged();
144 q->insetChange(getInset(), oldInset);
145 }
146}
147
149{
150 if (!background)
151 return;
152
153 resizingBackground = true;
154
156 if (((!p->widthValid() || !extra.isAllocated() || !extra->hasBackgroundWidth) && qFuzzyIsNull(background->x()))
157 || (extra.isAllocated() && (extra->hasLeftInset || extra->hasRightInset))) {
158 const bool wasWidthValid = p->widthValid();
161 // If the user hadn't previously set the width, that shouldn't change when we set it for them.
162 if (!wasWidthValid)
163 p->widthValidFlag = false;
164 }
165 if (((!p->heightValid() || !extra.isAllocated() || !extra->hasBackgroundHeight) && qFuzzyIsNull(background->y()))
166 || (extra.isAllocated() && (extra->hasTopInset || extra->hasBottomInset))) {
167 const bool wasHeightValid = p->heightValid();
170 if (!wasHeightValid)
171 p->heightValidFlag = false;
172 }
173
174 resizingBackground = false;
175}
176
186{
187 Q_Q(QQuickTextField);
189}
190
192{
193 QFont parentFont = extra.isAllocated() ? extra->requestedFont.resolve(font) : font;
194 parentFont.setResolveMask(extra.isAllocated() ? extra->requestedFont.resolveMask() | font.resolveMask() : font.resolveMask());
195
197 QFont resolvedFont = parentFont.resolve(defaultFont);
198
199 setFont_helper(resolvedFont);
200}
201
208{
209 Q_Q(QQuickTextField);
210 QFont oldFont = sourceFont;
211 q->QQuickTextInput::setFont(font);
212
214
215 if (oldFont != font)
216 emit q->fontChanged();
217}
218
219#if QT_CONFIG(quicktemplates2_hover)
220void QQuickTextFieldPrivate::updateHoverEnabled(bool enabled, bool xplicit)
221{
222 Q_Q(QQuickTextField);
223 if (!xplicit && explicitHoverEnabled)
224 return;
225
226 bool wasEnabled = q->isHoverEnabled();
227 explicitHoverEnabled = xplicit;
228 if (wasEnabled != enabled) {
229 q->setAcceptHoverEvents(enabled);
230 QQuickControlPrivate::updateHoverEnabledRecur(q, enabled);
231 emit q->hoverEnabledChanged();
232 }
233}
234#endif
235
237{
239}
240
242{
244}
245
247{
248 Q_Q(QQuickTextField);
250 emit q->implicitWidthChanged3();
251}
252
254{
255 Q_Q(QQuickTextField);
257 emit q->implicitHeightChanged3();
258}
259
261{
262 Q_UNUSED(isReadOnly);
263#if QT_CONFIG(accessibility)
264 if (QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(q_func()))
265 accessibleAttached->set_readOnly(isReadOnly);
266#endif
267#if QT_CONFIG(cursor)
268 q_func()->setCursor(isReadOnly && !selectByMouse ? Qt::ArrowCursor : Qt::IBeamCursor);
269#endif
270}
271
273{
274#if QT_CONFIG(accessibility)
275 if (QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(q_func()))
276 accessibleAttached->set_passwordEdit((echoMode == QQuickTextField::Password || echoMode == QQuickTextField::PasswordEchoOnEdit) ? true : false);
277#else
278 Q_UNUSED(echoMode);
279#endif
280}
281
282#if QT_CONFIG(accessibility)
283void QQuickTextFieldPrivate::accessibilityActiveChanged(bool active)
284{
285 if (!active)
286 return;
287
288 Q_Q(QQuickTextField);
289 QQuickAccessibleAttached *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(qmlAttachedPropertiesObject<QQuickAccessibleAttached>(q, true));
290 Q_ASSERT(accessibleAttached);
291 accessibleAttached->setRole(effectiveAccessibleRole());
292 accessibleAttached->set_readOnly(m_readOnly);
293 accessibleAttached->set_passwordEdit((m_echoMode == QQuickTextField::Password || m_echoMode == QQuickTextField::PasswordEchoOnEdit) ? true : false);
294 accessibleAttached->setDescription(placeholder);
295}
296
297QAccessible::Role QQuickTextFieldPrivate::accessibleRole() const
298{
299 return QAccessible::EditableText;
300}
301#endif
302
304{
305 Q_Q(QQuickTextField);
307}
308
310{
311 Q_Q(QQuickTextField);
313 return;
314
315 if (!background || complete)
317 if (complete)
319}
320
322{
323 Q_UNUSED(diff);
324 if (resizingBackground || item != background || !change.sizeChange())
325 return;
326
328 // QTBUG-71875: only allocate the extra data if we have to.
329 // resizeBackground() relies on the value of extra.isAllocated()
330 // as part of its checks to see whether it should resize the background or not.
331 if (p->widthValid() || extra.isAllocated())
332 extra.value().hasBackgroundWidth = p->widthValid();
333 if (p->heightValid() || extra.isAllocated())
334 extra.value().hasBackgroundHeight = p->heightValid();
336}
337
339{
340 Q_Q(QQuickTextField);
341 if (item == background)
342 emit q->implicitBackgroundWidthChanged();
343}
344
346{
347 Q_Q(QQuickTextField);
348 if (item == background)
349 emit q->implicitBackgroundHeightChanged();
350}
351
353{
354 Q_Q(QQuickTextField);
355 if (item == background) {
356 background = nullptr;
357 emit q->implicitBackgroundWidthChanged();
358 emit q->implicitBackgroundHeightChanged();
359 }
360}
361
363{
365}
366
369{
370 Q_D(QQuickTextField);
371 d->pressHandler.control = this;
372 d->setImplicitResizeEnabled(false);
375#if QT_CONFIG(cursor)
377#endif
380#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
381 if (qEnvironmentVariable("QT_QUICK_CONTROLS_TEXT_SELECTION_BEHAVIOR") == u"old"_s)
382 QQuickTextInput::setOldSelectionDefault();
383#endif
384}
385
387{
388 Q_D(QQuickTextField);
390}
391
393{
394 Q_D(const QQuickTextField);
396 // The resolve mask should inherit from the requestedFont
397 font.setResolveMask(d->extra.value().requestedFont.resolveMask());
398 return font;
399}
400
402{
403 Q_D(QQuickTextField);
404 if (d->extra.value().requestedFont.resolveMask() == font.resolveMask() && d->extra.value().requestedFont == font)
405 return;
406
407 d->extra.value().requestedFont = font;
408 d->resolveFont();
409}
410
421{
422 QQuickTextFieldPrivate *d = const_cast<QQuickTextFieldPrivate *>(d_func());
423 if (!d->background)
424 d->executeBackground();
425 return d->background;
426}
427
429{
430 Q_D(QQuickTextField);
431 if (d->background == background)
432 return;
433
435
436 if (!d->background.isExecuting())
437 d->cancelBackground();
438
439 const qreal oldImplicitBackgroundWidth = implicitBackgroundWidth();
440 const qreal oldImplicitBackgroundHeight = implicitBackgroundHeight();
441
442 if (d->extra.isAllocated()) {
443 d->extra.value().hasBackgroundWidth = false;
444 d->extra.value().hasBackgroundHeight = false;
445 }
446
449 d->background = background;
450
451 if (background) {
453 if (qFuzzyIsNull(background->z()))
454 background->setZ(-1);
456 if (p->widthValid() || p->heightValid()) {
457 d->extra.value().hasBackgroundWidth = p->widthValid();
458 d->extra.value().hasBackgroundHeight = p->heightValid();
459 }
461 d->resizeBackground();
463 }
464
465 if (!qFuzzyCompare(oldImplicitBackgroundWidth, implicitBackgroundWidth()))
466 emit implicitBackgroundWidthChanged();
467 if (!qFuzzyCompare(oldImplicitBackgroundHeight, implicitBackgroundHeight()))
468 emit implicitBackgroundHeightChanged();
469 if (!d->background.isExecuting())
471}
472
480{
481 Q_D(const QQuickTextField);
482 return d->placeholder;
483}
484
486{
487 Q_D(QQuickTextField);
488 if (d->placeholder == text)
489 return;
490
491 d->placeholder = text;
492#if QT_CONFIG(accessibility)
493 if (QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(this))
494 accessibleAttached->setDescription(text);
495#endif
497}
498
508{
509 Q_D(const QQuickTextField);
510 return d->placeholderColor;
511}
512
514{
515 Q_D(QQuickTextField);
516 if (d->placeholderColor == color)
517 return;
518
519 d->placeholderColor = color;
520 emit placeholderTextColorChanged();
521}
522
529{
530 Q_D(const QQuickTextField);
531 return d->focusReason;
532}
533
535{
536 Q_D(QQuickTextField);
537 if (d->focusReason == reason)
538 return;
539
540 d->focusReason = reason;
542}
543
554{
555#if QT_CONFIG(quicktemplates2_hover)
556 Q_D(const QQuickTextField);
557 return d->hovered;
558#else
559 return false;
560#endif
561}
562
564{
565#if QT_CONFIG(quicktemplates2_hover)
566 Q_D(QQuickTextField);
567 if (hovered == d->hovered)
568 return;
569
570 d->hovered = hovered;
571 emit hoveredChanged();
572#else
574#endif
575}
576
586{
587#if QT_CONFIG(quicktemplates2_hover)
588 Q_D(const QQuickTextField);
589 return d->hoverEnabled;
590#else
591 return false;
592#endif
593}
594
596{
597#if QT_CONFIG(quicktemplates2_hover)
598 Q_D(QQuickTextField);
599 if (d->explicitHoverEnabled && enabled == d->hoverEnabled)
600 return;
601
602 d->updateHoverEnabled(enabled, true); // explicit=true
603#else
605#endif
606}
607
609{
610#if QT_CONFIG(quicktemplates2_hover)
611 Q_D(QQuickTextField);
612 if (!d->explicitHoverEnabled)
613 return;
614
615 d->explicitHoverEnabled = false;
616 d->updateHoverEnabled(QQuickControlPrivate::calcHoverEnabled(d->parentItem), false); // explicit=false
617#endif
618}
619
621{
622 Q_D(QQuickTextField);
624 d->resolveFont();
625}
626
639{
640 Q_D(const QQuickTextField);
641 if (!d->background)
642 return 0;
643 return d->background->implicitWidth();
644}
645
658{
659 Q_D(const QQuickTextField);
660 if (!d->background)
661 return 0;
662 return d->background->implicitHeight();
663}
664
674{
675 Q_D(const QQuickTextField);
676 return d->getTopInset();
677}
678
680{
681 Q_D(QQuickTextField);
682 d->setTopInset(inset);
683}
684
686{
687 Q_D(QQuickTextField);
688 d->setTopInset(0, true);
689}
690
700{
701 Q_D(const QQuickTextField);
702 return d->getLeftInset();
703}
704
706{
707 Q_D(QQuickTextField);
708 d->setLeftInset(inset);
709}
710
712{
713 Q_D(QQuickTextField);
714 d->setLeftInset(0, true);
715}
716
726{
727 Q_D(const QQuickTextField);
728 return d->getRightInset();
729}
730
732{
733 Q_D(QQuickTextField);
734 d->setRightInset(inset);
735}
736
738{
739 Q_D(QQuickTextField);
740 d->setRightInset(0, true);
741}
742
752{
753 Q_D(const QQuickTextField);
754 return d->getBottomInset();
755}
756
758{
759 Q_D(QQuickTextField);
760 d->setBottomInset(inset);
761}
762
764{
765 Q_D(QQuickTextField);
766 d->setBottomInset(0, true);
767}
768
770{
771 Q_D(QQuickTextField);
772 d->executeBackground(true);
774 d->resizeBackground();
775#if QT_CONFIG(quicktemplates2_hover)
776 if (!d->explicitHoverEnabled)
777 setAcceptHoverEvents(QQuickControlPrivate::calcHoverEnabled(d->parentItem));
778#endif
779#if QT_CONFIG(accessibility)
780 if (QAccessible::isActive())
781 d->accessibilityActiveChanged(true);
782#endif
783}
784
786{
787 Q_D(QQuickTextField);
789 switch (change) {
791 break;
792 case ItemSceneChange:
794 if ((change == ItemParentHasChanged && value.item) || (change == ItemSceneChange && value.window)) {
795 d->resolveFont();
796#if QT_CONFIG(quicktemplates2_hover)
797 if (!d->explicitHoverEnabled)
798 d->updateHoverEnabled(QQuickControlPrivate::calcHoverEnabled(d->parentItem), false); // explicit=false
799#endif
800 }
801 break;
802 default:
803 break;
804 }
805}
806
807void QQuickTextField::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
808{
809 Q_D(QQuickTextField);
810 QQuickTextInput::geometryChange(newGeometry, oldGeometry);
811 d->resizeBackground();
812}
813
814void QQuickTextField::insetChange(const QMarginsF &newInset, const QMarginsF &oldInset)
815{
816 Q_D(QQuickTextField);
817 Q_UNUSED(newInset);
818 Q_UNUSED(oldInset);
819 d->resizeBackground();
820}
822{
823 QQuickDefaultClipNode *clipNode = static_cast<QQuickDefaultClipNode *>(oldNode);
824 if (!clipNode)
825 clipNode = new QQuickDefaultClipNode(QRectF());
826
827 clipNode->setRect(clipRect().adjusted(leftPadding(), topPadding(), -rightPadding(), -bottomPadding()));
828 clipNode->update();
829
831 if (!textNode->parent())
832 clipNode->appendChildNode(textNode);
833
834 return clipNode;
835}
836
838{
840 setFocusReason(event->reason());
841}
842
844{
846 setFocusReason(event->reason());
847}
848
849#if QT_CONFIG(quicktemplates2_hover)
851{
852 Q_D(QQuickTextField);
854 setHovered(d->hoverEnabled);
855 event->ignore();
856}
857
859{
861 setHovered(false);
862 event->ignore();
863}
864#endif
865
867{
868 Q_D(QQuickTextField);
869 d->pressHandler.mousePressEvent(event);
870 if (d->pressHandler.isActive()) {
871 if (d->pressHandler.delayedMousePressEvent) {
872 QQuickTextInput::mousePressEvent(d->pressHandler.delayedMousePressEvent.get());
873 d->pressHandler.clearDelayedMouseEvent();
874 }
875 if (event->buttons() != Qt::RightButton)
877 }
878}
879
881{
882 Q_D(QQuickTextField);
883 d->pressHandler.mouseMoveEvent(event);
884 if (d->pressHandler.isActive()) {
885 if (d->pressHandler.delayedMousePressEvent) {
886 QQuickTextInput::mousePressEvent(d->pressHandler.delayedMousePressEvent.get());
887 d->pressHandler.clearDelayedMouseEvent();
888 }
890 #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
891 || d->selectByTouchDrag
892 #endif
893 ;
894 if (event->buttons() != Qt::RightButton && isMouse)
896 }
897}
898
900{
901 Q_D(QQuickTextField);
902 d->pressHandler.mouseReleaseEvent(event);
903 if (d->pressHandler.isActive()) {
904 if (d->pressHandler.delayedMousePressEvent) {
905 QQuickTextInput::mousePressEvent(d->pressHandler.delayedMousePressEvent.get());
906 d->pressHandler.clearDelayedMouseEvent();
907 }
908 if (event->buttons() != Qt::RightButton)
910 }
911}
912
914{
915 Q_D(QQuickTextField);
916 if (d->pressHandler.delayedMousePressEvent) {
917 QQuickTextInput::mousePressEvent(d->pressHandler.delayedMousePressEvent.get());
918 d->pressHandler.clearDelayedMouseEvent();
919 }
920 if (event->buttons() != Qt::RightButton)
922}
923
925{
926 Q_D(QQuickTextField);
927 if (event->timerId() == d->pressHandler.timer.timerId())
928 d->pressHandler.timerEvent(event);
929 else
931}
932
934
935#include "moc_qquicktextfield_p.cpp"
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:469
\reentrant
Definition qfont.h:20
QFont resolve(const QFont &) const
Returns a new QFont that has attributes copied from other that have not been previously set on this f...
Definition qfont.cpp:1854
void setResolveMask(uint mask)
Definition qfont.h:252
uint resolveMask() const
Definition qfont.h:251
\inmodule QtGui
Definition qevent.h:245
\inmodule QtCore
Definition qmargins.h:274
constexpr qreal right() const noexcept
Returns the right margin.
Definition qmargins.h:370
constexpr qreal left() const noexcept
Returns the left margin.
Definition qmargins.h:364
constexpr qreal top() const noexcept
Returns the top margin.
Definition qmargins.h:367
constexpr qreal bottom() const noexcept
Returns the bottom margin.
Definition qmargins.h:373
\inmodule QtGui
Definition qevent.h:195
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)
Definition qobject_p.h:298
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
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 &)
static bool isEventFromMouseOrTouchpad(const QPointerEvent *ev)
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}.
Definition qquickitem.h:64
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...
Definition qquickitem.h:73
void setParentItem(QQuickItem *parent)
qreal z
\qmlproperty real QtQuick::Item::z
Definition qquickitem.h:75
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.
Definition qquickitem.h:74
void setHeight(qreal)
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
Sets the mouse buttons accepted by this item to buttons.
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.
void setZ(qreal)
void setWidth(qreal)
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
Definition qquickitem.h:143
@ ItemEnabledHasChanged
Definition qquickitem.h:154
@ ItemParentHasChanged
Definition qquickitem.h:148
friend class QQuickAccessibleAttached
Definition qquickitem.h:474
void setX(qreal)
virtual void hoverLeaveEvent(QHoverEvent *event)
This event handler can be reimplemented in a subclass to receive hover-leave events for an item.
void setY(qreal)
void setActiveFocusOnTab(bool)
void executeBackground(bool complete=false)
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
void echoModeChanged(QQuickTextField::EchoMode echoMode)
qreal getImplicitHeight() const override
void setBottomInset(qreal value, bool reset=false)
void inheritFont(const QFont &font)
QQuickDeferredPointer< QQuickItem > background
void setRightInset(qreal value, bool reset=false)
void itemImplicitWidthChanged(QQuickItem *item) override
void readOnlyChanged(bool isReadOnly)
void itemImplicitHeightChanged(QQuickItem *item) override
void setLeftInset(qreal value, bool reset=false)
qreal getImplicitWidth() const override
QQuickTextFieldPrivate()
Single-line text input field.
void setFont_helper(const QFont &font)
void implicitHeightChanged() override
void setTopInset(qreal value, bool reset=false)
void itemDestroyed(QQuickItem *item) override
void implicitWidthChanged() override
QLazilyAllocated< ExtraData > extra
void updateFont(const QFont &font)
QPalette defaultPalette() const override
void setFont(const QFont &font)
void focusOutEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive focus-out events for an item.
void focusReasonChanged()
void mouseMoveEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse move events for an item.
void setTopInset(qreal inset)
void itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
void setBackground(QQuickItem *background)
void mouseDoubleClickEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse double-click events for an ite...
void classBegin() override
\reimp Derived classes should call the base class method before adding their own action to perform at...
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void setBottomInset(qreal inset)
void mouseReleaseEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse release events for an item.
void backgroundChanged()
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 setPlaceholderTextColor(const QColor &color)
QQuickTextField(QQuickItem *parent=nullptr)
void setHoverEnabled(bool enabled)
QQuickItem * background
void componentComplete() override
\reimp Derived classes should call the base class method before adding their own actions to perform a...
void placeholderTextChanged()
bool isHovered() const
void setPlaceholderText(const QString &text)
void setHovered(bool hovered)
void setLeftInset(qreal inset)
bool isHoverEnabled() const
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
void focusInEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive focus-in events for an item.
Qt::FocusReason focusReason
void mousePressEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
void setFocusReason(Qt::FocusReason reason)
void setRightInset(qreal inset)
virtual void insetChange(const QMarginsF &newInset, const QMarginsF &oldInset)
QQuickTextInput::EchoMode m_echoMode
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.
QRectF clipRect() const override
Returns the rectangular area within this item that is currently visible in \l viewportItem(),...
void mouseReleaseEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse release events for an item.
FINALqreal bottomPadding
FINALqreal rightPadding
void focusOutEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive focus-out events for an item.
void readOnlyChanged(bool isReadOnly)
void echoModeChanged(QQuickTextInput::EchoMode echoMode)
void componentComplete() override
\reimp Derived classes should call the base class method before adding their own actions to perform a...
void focusInEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive focus-in events for an item.
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void mousePressEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
void mouseDoubleClickEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse double-click events for an ite...
void mouseMoveEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse move events for an item.
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
static QPalette palette(Scope scope)
static QFont font(Scope scope)
\inmodule QtCore\reentrant
Definition qrect.h:483
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
void appendChildNode(QSGNode *node)
Appends node to this node's list of children.
Definition qsgnode.cpp:396
QSGNode * parent() const
Returns the parent node of this node.
Definition qsgnode.h:93
QSGNode * firstChild() const
Returns the first child of this node.
Definition qsgnode.h:105
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qcoreevent.h:359
QString text
Combined button and popup list for selecting options.
@ AllButtons
Definition qnamespace.h:89
@ RightButton
Definition qnamespace.h:58
@ ArrowCursor
@ IBeamCursor
FocusReason
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Definition qfloat16.h:287
bool qFuzzyIsNull(qfloat16 f) noexcept
Definition qfloat16.h:303
GLint GLsizei GLsizei height
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei width
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
struct _cl_event * event
GLboolean reset
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]
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 Q_ASSERT(cond)
Definition qrandom.cpp:47
#define QStringLiteral(str)
QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
#define emit
#define Q_UNUSED(x)
static QString backgroundName()
double qreal
Definition qtypes.h:92
item setCursor(Qt::IBeamCursor)
[1]
QGraphicsItem * item
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
\inmodule QtQuick
Definition qquickitem.h:158