Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
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
240
245
252
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
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
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
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)
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
543{
544 Q_D(const QQuickTextField);
545 return d->lastFocusChangeReason();
546}
547
549{
550 Q_D(QQuickTextField);
551 d->setLastFocusChangeReason(reason);
553}
554
565{
566#if QT_CONFIG(quicktemplates2_hover)
567 Q_D(const QQuickTextField);
568 return d->hovered;
569#else
570 return false;
571#endif
572}
573
575{
576#if QT_CONFIG(quicktemplates2_hover)
577 Q_D(QQuickTextField);
578 if (hovered == d->hovered)
579 return;
580
581 d->hovered = hovered;
582 emit hoveredChanged();
583#else
585#endif
586}
587
597{
598#if QT_CONFIG(quicktemplates2_hover)
599 Q_D(const QQuickTextField);
600 return d->hoverEnabled;
601#else
602 return false;
603#endif
604}
605
607{
608#if QT_CONFIG(quicktemplates2_hover)
609 Q_D(QQuickTextField);
610 if (d->explicitHoverEnabled && enabled == d->hoverEnabled)
611 return;
612
613 d->updateHoverEnabled(enabled, true); // explicit=true
614#else
616#endif
617}
618
620{
621#if QT_CONFIG(quicktemplates2_hover)
622 Q_D(QQuickTextField);
623 if (!d->explicitHoverEnabled)
624 return;
625
626 d->explicitHoverEnabled = false;
627 d->updateHoverEnabled(QQuickControlPrivate::calcHoverEnabled(d->parentItem), false); // explicit=false
628#endif
629}
630
632{
633 Q_D(QQuickTextField);
635 d->resolveFont();
636}
637
650{
651 Q_D(const QQuickTextField);
652 if (!d->background)
653 return 0;
654 return d->background->implicitWidth();
655}
656
669{
670 Q_D(const QQuickTextField);
671 if (!d->background)
672 return 0;
673 return d->background->implicitHeight();
674}
675
685{
686 Q_D(const QQuickTextField);
687 return d->getTopInset();
688}
689
691{
692 Q_D(QQuickTextField);
693 d->setTopInset(inset);
694}
695
697{
698 Q_D(QQuickTextField);
699 d->setTopInset(0, true);
700}
701
711{
712 Q_D(const QQuickTextField);
713 return d->getLeftInset();
714}
715
717{
718 Q_D(QQuickTextField);
719 d->setLeftInset(inset);
720}
721
723{
724 Q_D(QQuickTextField);
725 d->setLeftInset(0, true);
726}
727
737{
738 Q_D(const QQuickTextField);
739 return d->getRightInset();
740}
741
743{
744 Q_D(QQuickTextField);
745 d->setRightInset(inset);
746}
747
749{
750 Q_D(QQuickTextField);
751 d->setRightInset(0, true);
752}
753
763{
764 Q_D(const QQuickTextField);
765 return d->getBottomInset();
766}
767
769{
770 Q_D(QQuickTextField);
771 d->setBottomInset(inset);
772}
773
775{
776 Q_D(QQuickTextField);
777 d->setBottomInset(0, true);
778}
779
781{
782 Q_D(QQuickTextField);
783 d->executeBackground(true);
785 d->resizeBackground();
786#if QT_CONFIG(quicktemplates2_hover)
787 if (!d->explicitHoverEnabled)
788 setAcceptHoverEvents(QQuickControlPrivate::calcHoverEnabled(d->parentItem));
789#endif
790#if QT_CONFIG(accessibility)
791 if (QAccessible::isActive())
792 d->accessibilityActiveChanged(true);
793#endif
794}
795
797{
798 Q_D(QQuickTextField);
800 switch (change) {
802 break;
803 case ItemSceneChange:
805 if ((change == ItemParentHasChanged && value.item) || (change == ItemSceneChange && value.window)) {
806 d->resolveFont();
807#if QT_CONFIG(quicktemplates2_hover)
808 if (!d->explicitHoverEnabled)
809 d->updateHoverEnabled(QQuickControlPrivate::calcHoverEnabled(d->parentItem), false); // explicit=false
810#endif
811 }
812 break;
813 default:
814 break;
815 }
816}
817
818void QQuickTextField::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
819{
820 Q_D(QQuickTextField);
821 QQuickTextInput::geometryChange(newGeometry, oldGeometry);
822 d->resizeBackground();
823}
824
825void QQuickTextField::insetChange(const QMarginsF &newInset, const QMarginsF &oldInset)
826{
827 Q_D(QQuickTextField);
828 Q_UNUSED(newInset);
829 Q_UNUSED(oldInset);
830 d->resizeBackground();
831}
833{
834 QQuickDefaultClipNode *clipNode = static_cast<QQuickDefaultClipNode *>(oldNode);
835 if (!clipNode)
836 clipNode = new QQuickDefaultClipNode(QRectF());
837
838 clipNode->setRect(clipRect().adjusted(leftPadding(), topPadding(), -rightPadding(), -bottomPadding()));
839 clipNode->update();
840
842 if (!textNode->parent())
843 clipNode->appendChildNode(textNode);
844
845 return clipNode;
846}
847
852
857
858#if QT_CONFIG(quicktemplates2_hover)
860{
861 Q_D(QQuickTextField);
863 setHovered(d->hoverEnabled);
864 event->ignore();
865}
866
868{
870 setHovered(false);
871 event->ignore();
872}
873#endif
874
876{
877 Q_D(QQuickTextField);
878 d->pressHandler.mousePressEvent(event);
879 if (d->pressHandler.isActive()) {
880 if (d->pressHandler.delayedMousePressEvent) {
881 QQuickTextInput::mousePressEvent(d->pressHandler.delayedMousePressEvent.get());
882 d->pressHandler.clearDelayedMouseEvent();
883 }
884 if (event->buttons() != Qt::RightButton)
886 }
887}
888
890{
891 Q_D(QQuickTextField);
892 d->pressHandler.mouseMoveEvent(event);
893 if (d->pressHandler.isActive()) {
894 if (d->pressHandler.delayedMousePressEvent) {
895 QQuickTextInput::mousePressEvent(d->pressHandler.delayedMousePressEvent.get());
896 d->pressHandler.clearDelayedMouseEvent();
897 }
899 #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
900 || d->selectByTouchDrag
901 #endif
902 ;
903 if (event->buttons() != Qt::RightButton && isMouse)
905 }
906}
907
909{
910 Q_D(QQuickTextField);
911 d->pressHandler.mouseReleaseEvent(event);
912 if (d->pressHandler.isActive()) {
913 if (d->pressHandler.delayedMousePressEvent) {
914 QQuickTextInput::mousePressEvent(d->pressHandler.delayedMousePressEvent.get());
915 d->pressHandler.clearDelayedMouseEvent();
916 }
917 if (event->buttons() != Qt::RightButton)
919 }
920}
921
923{
924 Q_D(QQuickTextField);
925 if (d->pressHandler.delayedMousePressEvent) {
926 QQuickTextInput::mousePressEvent(d->pressHandler.delayedMousePressEvent.get());
927 d->pressHandler.clearDelayedMouseEvent();
928 }
929 if (event->buttons() != Qt::RightButton)
931}
932
934{
935 Q_D(QQuickTextField);
936 if (event->timerId() == d->pressHandler.timer.timerId())
937 d->pressHandler.timerEvent(event);
938 else
940}
941
943
944#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:470
\reentrant
Definition qfont.h:22
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:1893
void setResolveMask(uint mask)
Definition qfont.h:313
uint resolveMask() const
Definition qfont.h:312
\inmodule QtGui
Definition qevent.h:246
\inmodule QtCore
Definition qmargins.h:270
\inmodule QtGui
Definition qevent.h:196
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:299
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:63
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:72
void setParentItem(QQuickItem *parent)
qreal z
\qmlproperty real QtQuick::Item::z
Definition qquickitem.h:74
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:73
void setHeight(qreal)
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
Sets the mouse buttons accepted by this item to buttons.
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:144
@ ItemEnabledHasChanged
Definition qquickitem.h:155
@ ItemParentHasChanged
Definition qquickitem.h:149
friend class QQuickAccessibleAttached
Definition qquickitem.h:479
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.
void itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
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.
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:484
\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:398
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:129
\inmodule QtCore
Definition qcoreevent.h:366
QString text
Combined button and popup list for selecting options.
@ AllButtons
Definition qnamespace.h:90
@ RightButton
Definition qnamespace.h:59
@ ArrowCursor
@ IBeamCursor
FocusReason
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Definition qfloat16.h:333
bool qFuzzyIsNull(qfloat16 f) noexcept
Definition qfloat16.h:349
GLint GLsizei GLsizei height
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei width
GLuint color
[2]
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:187
item setCursor(Qt::IBeamCursor)
[1]
QGraphicsItem * item
\inmodule QtQuick
Definition qquickitem.h:159