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
QQuickTextInput Class Reference

#include <qquicktextinput_p.h>

+ Inheritance diagram for QQuickTextInput:
+ Collaboration diagram for QQuickTextInput:

Public Types

enum  EchoMode { Normal , NoEcho , Password , PasswordEchoOnEdit }
 
enum  HAlignment { AlignLeft = Qt::AlignLeft , AlignRight = Qt::AlignRight , AlignHCenter = Qt::AlignHCenter }
 
enum  VAlignment { AlignTop = Qt::AlignTop , AlignBottom = Qt::AlignBottom , AlignVCenter = Qt::AlignVCenter }
 
enum  WrapMode {
  NoWrap = QTextOption::NoWrap , WordWrap = QTextOption::WordWrap , WrapAnywhere = QTextOption::WrapAnywhere , WrapAtWordBoundaryOrAnywhere = QTextOption::WrapAtWordBoundaryOrAnywhere ,
  Wrap = QTextOption::WrapAtWordBoundaryOrAnywhere
}
 
enum  SelectionMode { SelectCharacters , SelectWords }
 
enum  CursorPosition { CursorBetweenCharacters , CursorOnCharacter }
 
enum  RenderType { QtRendering , NativeRendering , CurveRendering }
 
- Public Types inherited from QQuickItem
enum  Flag {
  ItemClipsChildrenToShape = 0x01 , ItemIsFocusScope = 0x04 , ItemHasContents = 0x08 , ItemAcceptsDrops = 0x10 ,
  ItemIsViewport = 0x20 , ItemObservesViewport = 0x40
}
 \qmltype Item \instantiates QQuickItem \inherits QtObject \inqmlmodule QtQuick More...
 
enum  ItemChange {
  ItemChildAddedChange , ItemChildRemovedChange , ItemSceneChange , ItemVisibleHasChanged ,
  ItemParentHasChanged , ItemOpacityHasChanged , ItemActiveFocusHasChanged , ItemRotationHasChanged ,
  ItemAntialiasingHasChanged , ItemDevicePixelRatioHasChanged , ItemEnabledHasChanged
}
 Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes. More...
 
enum  TransformOrigin {
  TopLeft , Top , TopRight , Left ,
  Center , Right , BottomLeft , Bottom ,
  BottomRight
}
 \variable QQuickItem::ItemChangeData::realValue The numeric value that has changed: \l {QQuickItem::opacity()}{opacity}, \l {QQuickItem::rotation()}{rotation}, or \l {QScreen::devicePixelRatio}{device pixel ratio}. More...
 

Public Slots

void selectAll ()
 \qmlmethod QtQuick::TextInput::selectAll()
 
void selectWord ()
 \qmlmethod QtQuick::TextInput::selectWord()
 
void select (int start, int end)
 \qmlmethod QtQuick::TextInput::select(int start, int end)
 
void deselect ()
 \qmlmethod QtQuick::TextInput::deselect()
 
bool isRightToLeft (int start, int end)
 \qmlmethod QtQuick::TextInput::isRightToLeft(int start, int end)
 
void undo ()
 \qmlmethod QtQuick::TextInput::undo()
 
void redo ()
 \qmlmethod QtQuick::TextInput::redo()
 
void insert (int position, const QString &text)
 \qmlmethod QtQuick::TextInput::insert(int position, string text)
 
void remove (int start, int end)
 \qmlmethod QtQuick::TextInput::remove(int start, int end)
 
 Q_REVISION (2, 4) void ensureVisible(int position)
 
 Q_REVISION (2, 7) void clear()
 
- Public Slots inherited from QQuickItem
void update ()
 Schedules a call to updatePaintNode() for this item.
 
- Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
 

Signals

void textChanged ()
 
void cursorPositionChanged ()
 
void cursorRectangleChanged ()
 
void selectionStartChanged ()
 
void selectionEndChanged ()
 
void selectedTextChanged ()
 
void accepted ()
 
void acceptableInputChanged ()
 
 Q_REVISION (2, 2) void editingFinished()
 
 Q_REVISION (2, 9) void textEdited()
 
void colorChanged ()
 
void selectionColorChanged ()
 
void selectedTextColorChanged ()
 
void fontChanged (const QFont &font)
 
void horizontalAlignmentChanged (QQuickTextInput::HAlignment alignment)
 
void verticalAlignmentChanged (QQuickTextInput::VAlignment alignment)
 
void wrapModeChanged ()
 
void readOnlyChanged (bool isReadOnly)
 
void cursorVisibleChanged (bool isCursorVisible)
 
void cursorDelegateChanged ()
 
void overwriteModeChanged (bool overwriteMode)
 
void maximumLengthChanged (int maximumLength)
 
void inputMaskChanged (const QString &inputMask)
 
void echoModeChanged (QQuickTextInput::EchoMode echoMode)
 
void passwordCharacterChanged ()
 
 Q_REVISION (2, 4) void passwordMaskDelayChanged(int delay)
 
void displayTextChanged ()
 
 Q_REVISION (2, 7) void preeditTextChanged()
 
void activeFocusOnPressChanged (bool activeFocusOnPress)
 
void autoScrollChanged (bool autoScroll)
 
void selectByMouseChanged (bool selectByMouse)
 
void mouseSelectionModeChanged (QQuickTextInput::SelectionMode mode)
 
void persistentSelectionChanged ()
 
void canPasteChanged ()
 
void canUndoChanged ()
 
void canRedoChanged ()
 
void inputMethodComposingChanged ()
 
void effectiveHorizontalAlignmentChanged ()
 
void contentSizeChanged ()
 
void inputMethodHintsChanged ()
 
void renderTypeChanged ()
 
 Q_REVISION (2, 6) void paddingChanged()
 
 Q_REVISION (2, 6) void topPaddingChanged()
 
 Q_REVISION (2, 6) void leftPaddingChanged()
 
 Q_REVISION (2, 6) void rightPaddingChanged()
 
 Q_REVISION (2, 6) void bottomPaddingChanged()
 
- Signals inherited from QQuickItem
void childrenRectChanged (const QRectF &)
 
void baselineOffsetChanged (qreal)
 
void stateChanged (const QString &)
 
void focusChanged (bool)
 
void activeFocusChanged (bool)
 
Q_REVISION(6, 7) void focusPolicyChanged(Qt Q_REVISION (2, 1) void activeFocusOnTabChanged(bool)
 
void parentChanged (QQuickItem *)
 
void transformOriginChanged (TransformOrigin)
 
void smoothChanged (bool)
 
void antialiasingChanged (bool)
 
void clipChanged (bool)
 
 Q_REVISION (2, 1) void windowChanged(QQuickWindow *window)
 
void childrenChanged ()
 
void opacityChanged ()
 
void enabledChanged ()
 
void visibleChanged ()
 
void visibleChildrenChanged ()
 
void rotationChanged ()
 
void scaleChanged ()
 
void xChanged ()
 
void yChanged ()
 
void widthChanged ()
 
void heightChanged ()
 
void zChanged ()
 
void implicitWidthChanged ()
 
void implicitHeightChanged ()
 
 Q_REVISION (2, 11) void containmentMaskChanged()
 
 Q_REVISION (6, 0) void paletteChanged()
 
 Q_REVISION (6, 0) void paletteCreated()
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 This signal is emitted after the object's name has been changed.
 

Public Member Functions

 QQuickTextInput (QQuickItem *parent=nullptr)
 \qmltype TextInput \instantiates QQuickTextInput \inqmlmodule QtQuick\inherits Item
 
 ~QQuickTextInput ()
 
void componentComplete () override
 \reimp Derived classes should call the base class method before adding their own actions to perform at componentComplete.
 
Q_INVOKABLE void positionAt (QQmlV4FunctionPtr args) const
 \qmlmethod int QtQuick::TextInput::positionAt(real x, real y, CursorPosition position)
 
Q_INVOKABLE QRectF positionToRectangle (int pos) const
 \qmlmethod rect QtQuick::TextInput::positionToRectangle(int pos)
 
Q_INVOKABLE void moveCursorSelection (int pos)
 
Q_INVOKABLE void moveCursorSelection (int pos, SelectionMode mode)
 \qmlmethod QtQuick::TextInput::moveCursorSelection(int position, SelectionMode mode)
 
RenderType renderType () const
 \qmlproperty enumeration QtQuick::TextInput::renderType
 
void setRenderType (RenderType renderType)
 
QString text () const
 \qmlproperty string QtQuick::TextInput::text
 
void setText (const QString &)
 
int length () const
 \qmlproperty int QtQuick::TextInput::length
 
QFont font () const
 \qmlproperty string QtQuick::TextInput::font.family
 
void setFont (const QFont &font)
 
QColor color () const
 \qmlproperty color QtQuick::TextInput::color
 
void setColor (const QColor &c)
 
QColor selectionColor () const
 \qmlproperty color QtQuick::TextInput::selectionColor
 
void setSelectionColor (const QColor &c)
 
QColor selectedTextColor () const
 \qmlproperty color QtQuick::TextInput::selectedTextColor
 
void setSelectedTextColor (const QColor &c)
 
HAlignment hAlign () const
 \qmlproperty enumeration QtQuick::TextInput::effectiveHorizontalAlignment \readonly
 
void setHAlign (HAlignment align)
 
void resetHAlign ()
 
HAlignment effectiveHAlign () const
 
VAlignment vAlign () const
 
void setVAlign (VAlignment align)
 
WrapMode wrapMode () const
 \qmlproperty enumeration QtQuick::TextInput::wrapMode
 
void setWrapMode (WrapMode w)
 
bool isReadOnly () const
 \qmlproperty bool QtQuick::TextInput::readOnly
 
void setReadOnly (bool)
 
bool isCursorVisible () const
 \qmlproperty bool QtQuick::TextInput::cursorVisible Set to true when the TextInput shows a cursor.
 
void setCursorVisible (bool on)
 
int cursorPosition () const
 \qmlproperty int QtQuick::TextInput::cursorPosition The position of the cursor in the TextInput.
 
void setCursorPosition (int cp)
 
QRectF cursorRectangle () const
 \qmlproperty rectangle QtQuick::TextInput::cursorRectangle \readonly
 
int selectionStart () const
 \qmlproperty int QtQuick::TextInput::selectionStart
 
int selectionEnd () const
 \qmlproperty int QtQuick::TextInput::selectionEnd
 
QString selectedText () const
 \qmlproperty string QtQuick::TextInput::selectedText \readonly
 
int maxLength () const
 \qmlproperty int QtQuick::TextInput::maximumLength The maximum permitted length of the text in the TextInput.
 
void setMaxLength (int ml)
 
QString inputMask () const
 \qmlproperty string QtQuick::TextInput::inputMask
 
void setInputMask (const QString &im)
 
EchoMode echoMode () const
 \qmlsignal QtQuick::TextInput::accepted()
 
void setEchoMode (EchoMode echo)
 
QString passwordCharacter () const
 \qmlproperty string QtQuick::TextInput::passwordCharacter
 
void setPasswordCharacter (const QString &str)
 
int passwordMaskDelay () const
 \qmlproperty int QtQuick::TextInput::passwordMaskDelay
 
void setPasswordMaskDelay (int delay)
 
void resetPasswordMaskDelay ()
 
QString displayText () const
 \qmlproperty string QtQuick::TextInput::displayText
 
 Q_REVISION (2, 7) QString preeditText() const
 
QQmlComponentcursorDelegate () const
 \qmlproperty Component QtQuick::TextInput::cursorDelegate The delegate for the cursor in the TextInput.
 
void setCursorDelegate (QQmlComponent *)
 
bool overwriteMode () const
 \qmlproperty bool QtQuick::TextInput::overwriteMode
 
void setOverwriteMode (bool overwrite)
 
bool focusOnPress () const
 \qmlproperty bool QtQuick::TextInput::activeFocusOnPress
 
void setFocusOnPress (bool)
 
bool autoScroll () const
 \qmlproperty bool QtQuick::TextInput::autoScroll
 
void setAutoScroll (bool)
 
bool selectByMouse () const
 \qmlproperty bool QtQuick::TextInput::selectByMouse
 
void setSelectByMouse (bool)
 
SelectionMode mouseSelectionMode () const
 \qmlproperty enumeration QtQuick::TextInput::mouseSelectionMode
 
void setMouseSelectionMode (SelectionMode mode)
 
bool persistentSelection () const
 \qmlproperty bool QtQuick::TextInput::persistentSelection
 
void setPersistentSelection (bool persist)
 
bool hasAcceptableInput () const
 \qmlproperty bool QtQuick::TextInput::acceptableInput \readonly
 
QRectF boundingRect () const override
 Returns the extents of the item in its own coordinate system: a rectangle from {0, 0} to \l width() and \l height().
 
QRectF clipRect () const override
 Returns the rectangular area within this item that is currently visible in \l viewportItem(), if there is a viewport and the \l ItemObservesViewport flag is set; otherwise, the extents of this item in its own coordinate system: a rectangle from {0, 0} to \l width() and \l height().
 
bool canPaste () const
 \qmlproperty bool QtQuick::TextInput::canPaste \readonly
 
bool canUndo () const
 \qmlproperty bool QtQuick::TextInput::canUndo \readonly
 
bool canRedo () const
 \qmlproperty bool QtQuick::TextInput::canRedo \readonly
 
bool isInputMethodComposing () const
 \qmlproperty bool QtQuick::TextInput::inputMethodComposing \readonly
 
Qt::InputMethodHints inputMethodHints () const
 \qmlproperty enumeration QtQuick::TextInput::inputMethodHints
 
void setInputMethodHints (Qt::InputMethodHints hints)
 
Q_INVOKABLE QString getText (int start, int end) const
 \qmlmethod string QtQuick::TextInput::getText(int start, int end)
 
qreal contentWidth () const
 \qmlproperty real QtQuick::TextInput::contentWidth \readonly
 
qreal contentHeight () const
 \qmlproperty real QtQuick::TextInput::contentHeight \readonly
 
qreal padding () const
 
void setPadding (qreal padding)
 
void resetPadding ()
 
qreal topPadding () const
 
void setTopPadding (qreal padding)
 
void resetTopPadding ()
 
qreal leftPadding () const
 
void setLeftPadding (qreal padding)
 
void resetLeftPadding ()
 
qreal rightPadding () const
 
void setRightPadding (qreal padding)
 
void resetRightPadding ()
 
qreal bottomPadding () const
 
void setBottomPadding (qreal padding)
 
void resetBottomPadding ()
 
void invalidate () override
 
- Public Member Functions inherited from QQuickItem
 QQuickItem (QQuickItem *parent=nullptr)
 Constructs a QQuickItem with the given parent.
 
 ~QQuickItem () override
 Destroys the QQuickItem.
 
QQuickWindowwindow () const
 Returns the window in which this item is rendered.
 
QQuickItemparentItem () const
 
void setParentItem (QQuickItem *parent)
 
void stackBefore (const QQuickItem *)
 Moves the specified sibling item to the index before this item within the list of children.
 
void stackAfter (const QQuickItem *)
 Moves the specified sibling item to the index after this item within the list of children.
 
QRectF childrenRect ()
 \qmlpropertygroup QtQuick::Item::childrenRect \qmlproperty real QtQuick::Item::childrenRect.x \qmlproperty real QtQuick::Item::childrenRect.y \qmlproperty real QtQuick::Item::childrenRect.width \qmlproperty real QtQuick::Item::childrenRect.height \readonly
 
QList< QQuickItem * > childItems () const
 Returns the children of this item.
 
bool clip () const
 \qmlproperty bool QtQuick::Item::clip This property holds whether clipping is enabled.
 
void setClip (bool)
 
QString state () const
 \qmlproperty string QtQuick::Item::state
 
void setState (const QString &)
 
qreal baselineOffset () const
 \qmlproperty int QtQuick::Item::baselineOffset
 
void setBaselineOffset (qreal)
 
QQmlListProperty< QQuickTransformtransform ()
 
qreal x () const
 
qreal y () const
 
QPointF position () const
 
void setX (qreal)
 
void setY (qreal)
 
void setPosition (const QPointF &)
 
QBindable< qrealbindableX ()
 
QBindable< qrealbindableY ()
 
qreal width () const
 
void setWidth (qreal)
 
void resetWidth ()
 
void setImplicitWidth (qreal)
 
qreal implicitWidth () const
 Returns the width of the item that is implied by other properties that determine the content.
 
QBindable< qrealbindableWidth ()
 
qreal height () const
 
void setHeight (qreal)
 
void resetHeight ()
 
void setImplicitHeight (qreal)
 
qreal implicitHeight () const
 
QBindable< qrealbindableHeight ()
 
QSizeF size () const
 
void setSize (const QSizeF &size)
 
TransformOrigin transformOrigin () const
 
void setTransformOrigin (TransformOrigin)
 
QPointF transformOriginPoint () const
 
void setTransformOriginPoint (const QPointF &)
 
qreal z () const
 
void setZ (qreal)
 
qreal rotation () const
 
void setRotation (qreal)
 
qreal scale () const
 
void setScale (qreal)
 
qreal opacity () const
 
void setOpacity (qreal)
 
bool isVisible () const
 
void setVisible (bool)
 
bool isEnabled () const
 
void setEnabled (bool)
 
bool smooth () const
 
void setSmooth (bool)
 
bool activeFocusOnTab () const
 \qmlproperty bool QtQuick::Item::activeFocusOnTab
 
void setActiveFocusOnTab (bool)
 
bool antialiasing () const
 
void setAntialiasing (bool)
 
void resetAntialiasing ()
 
Flags flags () const
 Returns the item flags for this item.
 
void setFlag (Flag flag, bool enabled=true)
 Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disabled.
 
void setFlags (Flags flags)
 Enables the specified flags for this item.
 
QQuickItemviewportItem () const
 If the \l ItemObservesViewport flag is set, returns the nearest parent with the \l ItemIsViewport flag.
 
bool hasActiveFocus () const
 
bool hasFocus () const
 
void setFocus (bool)
 
void setFocus (bool focus, Qt::FocusReason reason)
 
bool isFocusScope () const
 Returns true if this item is a focus scope, and false otherwise.
 
QQuickItemscopedFocusItem () const
 If this item is a focus scope, this returns the item in its focus chain that currently has focus.
 
Qt::FocusPolicy focusPolicy () const
 
void setFocusPolicy (Qt::FocusPolicy policy)
 Sets the focus policy of this item to policy.
 
bool isAncestorOf (const QQuickItem *child) const
 Returns true if this item is an ancestor of child (i.e., if this item is child's parent, or one of child's parent's ancestors).
 
Qt::MouseButtons acceptedMouseButtons () const
 Returns the mouse buttons accepted by this item.
 
void setAcceptedMouseButtons (Qt::MouseButtons buttons)
 Sets the mouse buttons accepted by this item to buttons.
 
bool acceptHoverEvents () const
 Returns whether hover events are accepted by this item.
 
void setAcceptHoverEvents (bool enabled)
 If enabled is true, this sets the item to accept hover events; otherwise, hover events are not accepted by this item.
 
bool acceptTouchEvents () const
 Returns whether touch events are accepted by this item.
 
void setAcceptTouchEvents (bool accept)
 If enabled is true, this sets the item to accept touch events; otherwise, touch events are not accepted by this item.
 
bool isUnderMouse () const
 
void grabMouse ()
 
void ungrabMouse ()
 
bool keepMouseGrab () const
 Returns whether mouse input should exclusively remain with this item.
 
void setKeepMouseGrab (bool)
 Sets whether the mouse input should remain exclusively with this item.
 
bool filtersChildMouseEvents () const
 Returns whether pointer events intended for this item's children should be filtered through this item.
 
void setFiltersChildMouseEvents (bool filter)
 Sets whether pointer events intended for this item's children should be filtered through this item.
 
void grabTouchPoints (const QList< int > &ids)
 
void ungrabTouchPoints ()
 
bool keepTouchGrab () const
 Returns whether the touch points grabbed by this item should exclusively remain with this item.
 
void setKeepTouchGrab (bool)
 Sets whether the touch points grabbed by this item should remain exclusively with this item.
 
 Q_REVISION (2, 4) Q_INVOKABLE bool grabToImage(const QJSValue &callback
 
QSharedPointer< QQuickItemGrabResultgrabToImage (const QSize &targetSize=QSize())
 Grabs the item into an in-memory image.
 
virtual Q_INVOKABLE bool contains (const QPointF &point) const
 \qmlmethod bool QtQuick::Item::contains(point point)
 
QObjectcontainmentMask () const
 
void setContainmentMask (QObject *mask)
 
QTransform itemTransform (QQuickItem *, bool *) const
 \qmlmethod point QtQuick::Item::mapFromItem(Item item, real x, real y) \qmlmethod point QtQuick::Item::mapFromItem(Item item, point p) \qmlmethod rect QtQuick::Item::mapFromItem(Item item, real x, real y, real width, real height) \qmlmethod rect QtQuick::Item::mapFromItem(Item item, rect r)
 
QPointF mapToScene (const QPointF &point) const
 Maps the given point in this item's coordinate system to the equivalent point within the scene's coordinate system, and returns the mapped coordinate.
 
QRectF mapRectToItem (const QQuickItem *item, const QRectF &rect) const
 Maps the given rect in this item's coordinate system to the equivalent rectangular area within item's coordinate system, and returns the mapped rectangle value.
 
QRectF mapRectToScene (const QRectF &rect) const
 Maps the given rect in this item's coordinate system to the equivalent rectangular area within the scene's coordinate system, and returns the mapped rectangle value.
 
QPointF mapFromScene (const QPointF &point) const
 Maps the given point in the scene's coordinate system to the equivalent point within this item's coordinate system, and returns the mapped coordinate.
 
QRectF mapRectFromItem (const QQuickItem *item, const QRectF &rect) const
 Maps the given rect in item's coordinate system to the equivalent rectangular area within this item's coordinate system, and returns the mapped rectangle value.
 
QRectF mapRectFromScene (const QRectF &rect) const
 Maps the given rect in the scene's coordinate system to the equivalent rectangular area within this item's coordinate system, and returns the mapped rectangle value.
 
void polish ()
 Schedules a polish event for this item.
 
Q_INVOKABLE QPointF mapFromItem (const QQuickItem *item, const QPointF &point) const
 Maps the given point in item's coordinate system to the equivalent point within this item's coordinate system, and returns the mapped coordinate.
 
Q_INVOKABLE QPointF mapFromItem (const QQuickItem *item, qreal x, qreal y)
 
Q_INVOKABLE QRectF mapFromItem (const QQuickItem *item, const QRectF &rect) const
 
Q_INVOKABLE QRectF mapFromItem (const QQuickItem *item, qreal x, qreal y, qreal width, qreal height) const
 
Q_INVOKABLE QPointF mapToItem (const QQuickItem *item, const QPointF &point) const
 Maps the given point in this item's coordinate system to the equivalent point within item's coordinate system, and returns the mapped coordinate.
 
Q_INVOKABLE QPointF mapToItem (const QQuickItem *item, qreal x, qreal y)
 
Q_INVOKABLE QRectF mapToItem (const QQuickItem *item, const QRectF &rect) const
 
Q_INVOKABLE QRectF mapToItem (const QQuickItem *item, qreal x, qreal y, qreal width, qreal height) const
 
 Q_REVISION (2, 7) Q_INVOKABLE QPointF mapFromGlobal(qreal x
 
 Q_REVISION (2, 7) Q_INVOKABLE QPointF mapFromGlobal(const QPointF &point) const
 
 Q_REVISION (2, 7) Q_INVOKABLE QPointF mapToGlobal(qreal x
 
 Q_REVISION (2, 7) Q_INVOKABLE QPointF mapToGlobal(const QPointF &point) const
 
Q_INVOKABLE void forceActiveFocus ()
 \qmlmethod point QtQuick::Item::mapToItem(Item item, real x, real y) \qmlmethod point QtQuick::Item::mapToItem(Item item, point p) \qmlmethod rect QtQuick::Item::mapToItem(Item item, real x, real y, real width, real height) \qmlmethod rect QtQuick::Item::mapToItem(Item item, rect r)
 
Q_INVOKABLE void forceActiveFocus (Qt::FocusReason reason)
 \qmlmethod QtQuick::Item::forceActiveFocus(Qt::FocusReason reason) This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Forces active focus on the item with the given reason.
 
 Q_REVISION (2, 1) Q_INVOKABLE QQuickItem *nextItemInFocusChain(bool forward
 
Q_INVOKABLE QQuickItemchildAt (qreal x, qreal y) const
 \qmlmethod QtQuick::Item::childAt(real x, real y)
 
 Q_REVISION (6, 3) Q_INVOKABLE void ensurePolished()
 
 Q_REVISION (6, 3) Q_INVOKABLE void dumpItemTree() const
 
virtual bool isTextureProvider () const
 Returns true if this item is a texture provider.
 
virtual QSGTextureProvidertextureProvider () const
 Returns the texture provider for an item.
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 Constructs an object with parent object parent.
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects.
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object.
 
QString objectName () const
 
Q_WEAK_OVERLOAD void setObjectName (const QString &name)
 Sets the object's name to name.
 
void setObjectName (QAnyStringView name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false.
 
bool isWindowType () const
 Returns true if the object is a window; otherwise returns false.
 
bool isQuickItemType () const
 Returns true if the object is a QQuickItem; otherwise returns false.
 
bool signalsBlocked () const noexcept
 Returns true if signals are blocked; otherwise returns false.
 
bool blockSignals (bool b) noexcept
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
 
QThreadthread () const
 Returns the thread in which the object lives.
 
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.
 
int startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 Kills the timer with timer identifier, id.
 
void killTimer (Qt::TimerId id)
 
template<typename T >
findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.
 
template<typename T >
QList< T > findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
 
template<typename T >
findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
QList< T > findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const QObjectListchildren () const
 Returns a list of child objects.
 
void setParent (QObject *parent)
 Makes the object a child of parent.
 
void installEventFilter (QObject *filterObj)
 Installs an event filter filterObj on this object.
 
void removeEventFilter (QObject *obj)
 Removes an event filter object obj from this object.
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 Dumps a tree of children to the debug output.
 
void dumpObjectInfo () const
 Dumps information about signal connections, etc.
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value.
 
bool setProperty (const char *name, QVariant &&value)
 
QVariant property (const char *name) const
 Returns the value of the object's name property.
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 Returns a pointer to the parent object.
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.
 
- Public Member Functions inherited from QQmlParserStatus
 QQmlParserStatus ()
 
virtual ~QQmlParserStatus ()
 

Protected Member Functions

 QQuickTextInput (QQuickTextInputPrivate &dd, QQuickItem *parent=nullptr)
 
void geometryChange (const QRectF &newGeometry, const QRectF &oldGeometry) override
 
void itemChange (ItemChange change, const ItemChangeData &value) override
 Called when change occurs for this item.
 
void mousePressEvent (QMouseEvent *event) override
 This event handler can be reimplemented in a subclass to receive mouse press events for an item.
 
void mouseMoveEvent (QMouseEvent *event) override
 This event handler can be reimplemented in a subclass to receive mouse move events for an item.
 
void mouseReleaseEvent (QMouseEvent *event) override
 This event handler can be reimplemented in a subclass to receive mouse release 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 item.
 
void keyPressEvent (QKeyEvent *ev) override
 This event handler can be reimplemented in a subclass to receive key press events for an item.
 
void mouseUngrabEvent () override
 This event handler can be reimplemented in a subclass to be notified when a mouse ungrab event has occurred on this item.
 
bool event (QEvent *e) override
 \reimp
 
void focusOutEvent (QFocusEvent *event) override
 This event handler can be reimplemented in a subclass to receive focus-out events for an item.
 
void focusInEvent (QFocusEvent *event) override
 This event handler can be reimplemented in a subclass to receive focus-in 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.
 
QSGNodeupdatePaintNode (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 updatePolish () override
 This function should perform any layout as required for this item.
 
- Protected Member Functions inherited from QQuickImplicitSizeItem
 QQuickImplicitSizeItem (QQuickImplicitSizeItemPrivate &dd, QQuickItem *parent)
 
- Protected Member Functions inherited from QQuickItem
bool isComponentComplete () const
 Returns true if construction of the QML component is complete; otherwise returns false.
 
bool widthValid () const
 Returns whether the width property has been set explicitly.
 
bool heightValid () const
 Returns whether the height property has been set explicitly.
 
void setImplicitSize (qreal, qreal)
 
void classBegin () override
 \reimp Derived classes should call the base class method before adding their own action to perform at classBegin.
 
virtual void keyReleaseEvent (QKeyEvent *event)
 This event handler can be reimplemented in a subclass to receive key release events for an item.
 
virtual void touchUngrabEvent ()
 This event handler can be reimplemented in a subclass to be notified when a touch ungrab event has occurred on this item.
 
virtual void touchEvent (QTouchEvent *event)
 This event handler can be reimplemented in a subclass to receive touch events for an item.
 
virtual void hoverEnterEvent (QHoverEvent *event)
 This event handler can be reimplemented in a subclass to receive hover-enter events for an item.
 
virtual void hoverMoveEvent (QHoverEvent *event)
 This event handler can be reimplemented in a subclass to receive hover-move events for an item.
 
virtual void hoverLeaveEvent (QHoverEvent *event)
 This event handler can be reimplemented in a subclass to receive hover-leave events for an item.
 
virtual bool childMouseEventFilter (QQuickItem *, QEvent *)
 Reimplement this method to filter the pointer events that are received by this item's children.
 
virtual void releaseResources ()
 This function is called when an item should release graphics resources which are not already managed by the nodes returned from QQuickItem::updatePaintNode().
 
 QQuickItem (QQuickItemPrivate &dd, QQuickItem *parent=nullptr)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal.
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void childEvent (QChildEvent *event)
 This event handler can be reimplemented in a subclass to receive child events.
 
virtual void customEvent (QEvent *event)
 This event handler can be reimplemented in a subclass to receive custom events.
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 

Properties

QString text
 
int length
 
QColor color
 
QColor selectionColor
 
QColor selectedTextColor
 
QFont font
 
HAlignment horizontalAlignment
 
HAlignment effectiveHorizontalAlignment
 
VAlignment verticalAlignment
 
WrapMode wrapMode
 
bool readOnly
 
bool cursorVisible
 
int cursorPosition
 
QRectF cursorRectangle
 
QQmlComponentcursorDelegate
 
bool overwriteMode
 
int selectionStart
 
int selectionEnd
 
QString selectedText
 
int maximumLength
 
QString inputMask
 
Qt::InputMethodHints inputMethodHints
 
bool acceptableInput
 
EchoMode echoMode
 
bool activeFocusOnPress
 
QString passwordCharacter
 
int passwordMaskDelay
 
QString displayText
 
QString preeditText
 \qmlproperty string QtQuick::TextInput::preeditText \readonly
 
bool autoScroll
 
bool selectByMouse
 
SelectionMode mouseSelectionMode
 
bool persistentSelection
 
bool canPaste
 
bool canUndo
 
bool canRedo
 
bool inputMethodComposing
 
qreal contentWidth
 
qreal contentHeight
 
RenderType renderType
 
qreal padding
 
qreal topPadding
 
qreal leftPadding
 
qreal rightPadding
 
qreal bottomPadding
 
- Properties inherited from QQuickImplicitSizeItem
qreal implicitWidth
 
qreal implicitHeight
 
- Properties inherited from QQuickItem
QQuickItemparent
 \qmlproperty Item QtQuick::Item::parent This property holds the visual parent of the item.
 
qreal x
 \qmlproperty real QtQuick::Item::x \qmlproperty real QtQuick::Item::y \qmlproperty real QtQuick::Item::width \qmlproperty real QtQuick::Item::height
 
qreal y
 Defines the item's y position relative to its parent.
 
qreal z
 \qmlproperty real QtQuick::Item::z
 
qreal width
 This property holds the width of this item.
 
qreal height
 This property holds the height of this item.
 
qreal opacity
 \qmlproperty real QtQuick::Item::opacity
 
bool enabled
 \qmlproperty bool QtQuick::Item::enabled
 
bool visible
 \qmlproperty bool QtQuick::Item::visible
 
Qt::FocusPolicy focusPolicy
 \qmlproperty enumeration QtQuick::Item::focusPolicy
 
qreal rotation
 \qmlproperty real QtQuick::Item::rotation This property holds the rotation of the item in degrees clockwise around its transformOrigin.
 
qreal scale
 \qmlproperty real QtQuick::Item::scale This property holds the scale factor for this item.
 
TransformOrigin transformOrigin
 \qmlproperty enumeration QtQuick::Item::transformOrigin This property holds the origin point around which scale and rotation transform.
 
QPointF transformOriginPoint
 
QQmlListProperty< QQuickTransformtransform
 \qmlproperty list<Transform> QtQuick::Item::transform This property holds the list of transformations to apply.
 
bool smooth
 \qmlproperty bool QtQuick::Item::smooth
 
bool antialiasing
 \qmlproperty bool QtQuick::Item::antialiasing
 
qreal implicitWidth
 
qreal implicitHeight
 
QObjectcontainmentMask
 \qmlproperty QObject* QtQuick::Item::containmentMask
 
- Properties inherited from QObject
QString objectName
 the name of this object
 

Friends

class QQuickTextUtil
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 \threadsafe
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 \threadsafe
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 Disconnect a connection.
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 
- Public Attributes inherited from QQuickItem
const QSizetargetSize = QSize())
 
qreal y const
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Detailed Description

Definition at line 28 of file qquicktextinput_p.h.

Member Enumeration Documentation

◆ CursorPosition

Enumerator
CursorBetweenCharacters 
CursorOnCharacter 

Definition at line 134 of file qquicktextinput_p.h.

◆ EchoMode

Enumerator
Normal 
NoEcho 
Password 
PasswordEchoOnEdit 

Definition at line 97 of file qquicktextinput_p.h.

◆ HAlignment

Enumerator
AlignLeft 
AlignRight 
AlignHCenter 

Definition at line 105 of file qquicktextinput_p.h.

◆ RenderType

Enumerator
QtRendering 
NativeRendering 
CurveRendering 

Definition at line 140 of file qquicktextinput_p.h.

◆ SelectionMode

Enumerator
SelectCharacters 
SelectWords 

Definition at line 128 of file qquicktextinput_p.h.

◆ VAlignment

Enumerator
AlignTop 
AlignBottom 
AlignVCenter 

Definition at line 112 of file qquicktextinput_p.h.

◆ WrapMode

Enumerator
NoWrap 
WordWrap 
WrapAnywhere 
WrapAtWordBoundaryOrAnywhere 
Wrap 

Definition at line 119 of file qquicktextinput_p.h.

Constructor & Destructor Documentation

◆ QQuickTextInput() [1/2]

QT_BEGIN_NAMESPACE QQuickTextInput::QQuickTextInput ( QQuickItem * parent = nullptr)

\qmltype TextInput \instantiates QQuickTextInput \inqmlmodule QtQuick\inherits Item

Displays an editable line of text.

The TextInput type displays a single line of editable plain text.

TextInput is used to accept a line of text input. Input constraints can be placed on a TextInput item (for example, through a \l validator or \l inputMask), and setting \l echoMode to an appropriate value enables TextInput to be used for a password input field.

On \macos, the Up/Down key bindings for Home/End are explicitly disabled. If you want such bindings (on any platform), you will need to construct them in QML.

See also
TextEdit, Text

Definition at line 57 of file qquicktextinput.cpp.

References d.

◆ ~QQuickTextInput()

QQuickTextInput::~QQuickTextInput ( )

Definition at line 71 of file qquicktextinput.cpp.

◆ QQuickTextInput() [2/2]

QQuickTextInput::QQuickTextInput ( QQuickTextInputPrivate & dd,
QQuickItem * parent = nullptr )
protected

Definition at line 64 of file qquicktextinput.cpp.

References d.

Member Function Documentation

◆ acceptableInputChanged

void QQuickTextInput::acceptableInputChanged ( )
signal

Referenced by QQuickComboBox::contentItemChange().

+ Here is the caller graph for this function:

◆ accepted

void QQuickTextInput::accepted ( )
signal

Referenced by QQuickComboBox::contentItemChange(), QQuickComboBox::setEditable(), and QQuickFolderBreadcrumbBar::setTextField().

+ Here is the caller graph for this function:

◆ activeFocusOnPressChanged

void QQuickTextInput::activeFocusOnPressChanged ( bool activeFocusOnPress)
signal

Referenced by setFocusOnPress().

+ Here is the caller graph for this function:

◆ autoScroll()

bool QQuickTextInput::autoScroll ( ) const

\qmlproperty bool QtQuick::TextInput::autoScroll

Whether the TextInput should scroll when the text is longer than the width. By default this is set to true.

See also
ensureVisible()

Definition at line 1028 of file qquicktextinput.cpp.

References d.

◆ autoScrollChanged

void QQuickTextInput::autoScrollChanged ( bool autoScroll)
signal

Referenced by setAutoScroll().

+ Here is the caller graph for this function:

◆ bottomPadding()

qreal QQuickTextInput::bottomPadding ( ) const

Definition at line 4954 of file qquicktextinput.cpp.

References d.

◆ boundingRect()

QRectF QQuickTextInput::boundingRect ( ) const
overridevirtual

Returns the extents of the item in its own coordinate system: a rectangle from {0, 0} to \l width() and \l height().

Reimplemented from QQuickItem.

Definition at line 2935 of file qquicktextinput.cpp.

References QQuickTextUtil::alignedX(), d, and QQuickTextInputPrivate::hscroll.

+ Here is the call graph for this function:

◆ canPaste()

bool QQuickTextInput::canPaste ( ) const

\qmlproperty bool QtQuick::TextInput::canPaste \readonly

Returns true if the TextInput is writable and the content of the clipboard is suitable for pasting into the TextInput.

Definition at line 2590 of file qquicktextinput.cpp.

References canPaste, QGuiApplication::clipboard(), d, QMimeData::hasText(), QString::isEmpty(), mimeData, and QMimeData::text().

+ Here is the call graph for this function:

◆ canPasteChanged

void QQuickTextInput::canPasteChanged ( )
signal

◆ canRedo()

bool QQuickTextInput::canRedo ( ) const

\qmlproperty bool QtQuick::TextInput::canRedo \readonly

Returns true if the TextInput is writable and there are \l {undo}{undone} operations that can be redone.

Definition at line 2627 of file qquicktextinput.cpp.

References d.

◆ canRedoChanged

void QQuickTextInput::canRedoChanged ( )
signal

◆ canUndo()

bool QQuickTextInput::canUndo ( ) const

\qmlproperty bool QtQuick::TextInput::canUndo \readonly

Returns true if the TextInput is writable and there are previous operations that can be undone.

Definition at line 2613 of file qquicktextinput.cpp.

References d.

◆ canUndoChanged

void QQuickTextInput::canUndoChanged ( )
signal

◆ clipRect()

QRectF QQuickTextInput::clipRect ( ) const
overridevirtual

Returns the rectangular area within this item that is currently visible in \l viewportItem(), if there is a viewport and the \l ItemObservesViewport flag is set; otherwise, the extents of this item in its own coordinate system: a rectangle from {0, 0} to \l width() and \l height().

This is the region intended to remain visible if \l clip is true. It can also be used in updatePaintNode() to limit the graphics added to the scene graph.

For example, a large drawing or a large text document might be shown in a Flickable that occupies only part of the application's Window: in that case, Flickable is the viewport item, and a custom content-rendering item may choose to omit scene graph nodes that fall outside the area that is currently visible. If the \l ItemObservesViewport flag is set, this area will change each time the user scrolls the content in the Flickable.

In case of nested viewport items, clipRect() is the intersection of the {boundingRect}s of all ancestors that have the \l ItemIsViewport flag set, mapped to the coordinate system of this item.

See also
boundingRect()

Reimplemented from QQuickItem.

Definition at line 2951 of file qquicktextinput.cpp.

References QQuickItem::clipRect(), and d.

Referenced by updatePaintNode(), and QQuickTextField::updatePaintNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ color()

QColor QQuickTextInput::color ( ) const

\qmlproperty color QtQuick::TextInput::color

The text color.

Definition at line 441 of file qquicktextinput.cpp.

References d.

◆ colorChanged

void QQuickTextInput::colorChanged ( )
signal

Referenced by setColor().

+ Here is the caller graph for this function:

◆ componentComplete()

void QQuickTextInput::componentComplete ( )
overridevirtual

\reimp Derived classes should call the base class method before adding their own actions to perform at componentComplete.

Reimplemented from QQuickItem.

Definition at line 75 of file qquicktextinput.cpp.

References QQmlParserStatus::componentComplete(), QQuickTextUtil::createCursor(), d, and isCursorVisible().

Referenced by QQuickTextField::componentComplete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ contentHeight()

qreal QQuickTextInput::contentHeight ( ) const

\qmlproperty real QtQuick::TextInput::contentHeight \readonly

Returns the height of the text, including the height past the height that is covered if the text does not fit within the set height.

Definition at line 2655 of file qquicktextinput.cpp.

References d.

◆ contentSizeChanged

void QQuickTextInput::contentSizeChanged ( )
signal

◆ contentWidth()

qreal QQuickTextInput::contentWidth ( ) const

\qmlproperty real QtQuick::TextInput::contentWidth \readonly

Returns the width of the text, including the width past the width which is covered due to insufficient wrapping if \l wrapMode is set.

Definition at line 2641 of file qquicktextinput.cpp.

References d.

◆ cursorDelegate()

QQmlComponent * QQuickTextInput::cursorDelegate ( ) const

\qmlproperty Component QtQuick::TextInput::cursorDelegate The delegate for the cursor in the TextInput.

If you set a cursorDelegate for a TextInput, this delegate will be used for drawing the cursor instead of the standard cursor. An instance of the delegate will be created and managed by the TextInput when a cursor is needed, and the x property of the delegate instance will be set so as to be one pixel before the top left of the current character.

Note that the root item of the delegate component must be a QQuickItem or QQuickItem derived item.

Definition at line 1362 of file qquicktextinput.cpp.

References d.

◆ cursorDelegateChanged

void QQuickTextInput::cursorDelegateChanged ( )
signal

◆ cursorPosition()

int QQuickTextInput::cursorPosition ( ) const

\qmlproperty int QtQuick::TextInput::cursorPosition The position of the cursor in the TextInput.

The cursor is positioned between characters.

Note
The characters in this case refer to the string of \l QChar objects, therefore 16-bit Unicode characters, and the position is considered an index into this string. This does not necessarily correspond to individual graphemes in the writing system, as a single grapheme may be represented by multiple Unicode characters, such as in the case of surrogate pairs, linguistic ligatures or diacritics.

\l displayText is different if echoMode is set to {TextInput.Password}: then each passwordCharacter is a "narrow" character (the cursorPosition always moves by 1), even if the text in the TextInput is not.

Definition at line 874 of file qquicktextinput.cpp.

References d.

◆ cursorPositionChanged

void QQuickTextInput::cursorPositionChanged ( )
signal

◆ cursorRectangle()

QRectF QQuickTextInput::cursorRectangle ( ) const

\qmlproperty rectangle QtQuick::TextInput::cursorRectangle \readonly

The rectangle where the standard text cursor is rendered within the text input. Read only.

The position and height of a custom cursorDelegate are updated to follow the cursorRectangle automatically when it changes. The width of the delegate is unaffected by changes in the cursor rectangle.

Definition at line 899 of file qquicktextinput.cpp.

References QTextLine::cursorToX(), d, font, QTextLine::height(), QFontMetrics::horizontalAdvance(), QTextLine::isValid(), leftPadding, NoEcho, QQuickItem::size(), text, topPadding, QQuickItem::x, and QTextLine::y().

+ Here is the call graph for this function:

◆ cursorRectangleChanged

void QQuickTextInput::cursorRectangleChanged ( )
signal

◆ cursorVisibleChanged

void QQuickTextInput::cursorVisibleChanged ( bool isCursorVisible)
signal

Referenced by setCursorVisible().

+ Here is the caller graph for this function:

◆ deselect

void QQuickTextInput::deselect ( )
slot

\qmlmethod QtQuick::TextInput::deselect()

Removes active text selection.

Definition at line 2130 of file qquicktextinput.cpp.

References d.

◆ displayText()

QString QQuickTextInput::displayText ( ) const

\qmlproperty string QtQuick::TextInput::displayText

This is the text displayed in the TextInput.

If \l echoMode is set to TextInput::Normal, this holds the same value as the TextInput::text property. Otherwise, this property holds the text visible to the user, while the \l text property holds the actual entered text.

Note
Unlike the TextInput::text property, this contains partial text input from an input method.

\readonly

See also
preeditText

Definition at line 2478 of file qquicktextinput.cpp.

References d.

◆ displayTextChanged

void QQuickTextInput::displayTextChanged ( )
signal

◆ echoMode()

QQuickTextInput::EchoMode QQuickTextInput::echoMode ( ) const

\qmlsignal QtQuick::TextInput::accepted()

This signal is emitted when the Return or Enter key is pressed. Note that if there is a \l validator or \l inputMask set on the text input, the signal will only be emitted if the input is in an acceptable state.

\qmlsignal QtQuick::TextInput::editingFinished()

Since
5.2

This signal is emitted when the Return or Enter key is pressed or the text input loses focus. Note that if there is a validator or inputMask set on the text input and enter/return is pressed, this signal will only be emitted if the input follows the inputMask and the validator returns an acceptable state.

\qmlsignal QtQuick::TextInput::textEdited()

Since
5.9

This signal is emitted whenever the text is edited. Unlike textChanged(), this signal is not emitted when the text is changed programmatically, for example, by changing the value of the text property or by calling clear().

\qmlproperty enumeration QtQuick::TextInput::echoMode

Specifies how the text should be displayed in the TextInput.

\value TextInput.Normal Displays the text as it is. (Default) \value TextInput.Password Displays platform-dependent password mask characters instead of the actual characters. \value TextInput.NoEcho Displays nothing. \value TextInput.PasswordEchoOnEdit Displays characters as they are entered while editing, otherwise identical to TextInput.Password.

Definition at line 1257 of file qquicktextinput.cpp.

References d.

◆ echoModeChanged

void QQuickTextInput::echoModeChanged ( QQuickTextInput::EchoMode echoMode)
signal

Referenced by QQuickTextField::QQuickTextField(), and setEchoMode().

+ Here is the caller graph for this function:

◆ effectiveHAlign()

QQuickTextInput::HAlignment QQuickTextInput::effectiveHAlign ( ) const

Definition at line 575 of file qquicktextinput.cpp.

References AlignLeft, AlignRight, and d.

◆ effectiveHorizontalAlignmentChanged

void QQuickTextInput::effectiveHorizontalAlignmentChanged ( )
signal

◆ event()

◆ focusInEvent()

void QQuickTextInput::focusInEvent ( QFocusEvent * event)
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to receive focus-in events for an item.

The event information is provided by the event parameter.

\input item.qdocinc accepting-events

If you do reimplement this function, you should call the base class implementation.

Reimplemented from QQuickItem.

Definition at line 2759 of file qquicktextinput.cpp.

References d, and QQuickItem::focusInEvent().

Referenced by QQuickTextField::focusInEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ focusOnPress()

bool QQuickTextInput::focusOnPress ( ) const

\qmlproperty bool QtQuick::TextInput::activeFocusOnPress

Whether the TextInput should gain active focus on a mouse press. By default this is set to true.

Definition at line 1004 of file qquicktextinput.cpp.

References d.

◆ focusOutEvent()

void QQuickTextInput::focusOutEvent ( QFocusEvent * event)
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to receive focus-out events for an item.

The event information is provided by the event parameter.

\input item.qdocinc accepting-events

Reimplemented from QQuickItem.

Definition at line 2803 of file qquicktextinput.cpp.

References d, and QQuickItem::focusOutEvent().

Referenced by QQuickTextField::focusOutEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ font()

QFont QQuickTextInput::font ( ) const

\qmlproperty string QtQuick::TextInput::font.family

Sets the family name of the font.

The family name is case insensitive and may optionally include a foundry name, e.g. "Helvetica [Cronyx]". If the family is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen. If the family isn't available a family will be set using the font matching algorithm.

\qmlproperty string QtQuick::TextInput::font.styleName

Since
5.6

Sets the style name of the font.

The style name is case insensitive. If set, the font will be matched against style name instead of the font properties \l font.weight, \l font.bold and \l font.italic.

\qmlproperty bool QtQuick::TextInput::font.bold

Sets whether the font weight is bold.

\qmlproperty int QtQuick::TextInput::font.weight

The requested weight of the font. The weight requested must be an integer between 1 and 1000, or one of the predefined values:

\value Font.Thin 100 \value Font.ExtraLight 200 \value Font.Light 300 \value Font.Normal 400 (default) \value Font.Medium 500 \value Font.DemiBold 600 \value Font.Bold 700 \value Font.ExtraBold 800 \value Font.Black 900

\qml TextInput { text: "Hello"; font.weight: Font.DemiBold } \endqml

\qmlproperty bool QtQuick::TextInput::font.italic

Sets whether the font has an italic style.

\qmlproperty bool QtQuick::TextInput::font.underline

Sets whether the text is underlined.

\qmlproperty bool QtQuick::TextInput::font.strikeout

Sets whether the font has a strikeout style.

\qmlproperty real QtQuick::TextInput::font.pointSize

Sets the font size in points. The point size must be greater than zero.

\qmlproperty int QtQuick::TextInput::font.pixelSize

Sets the font size in pixels.

Using this function makes the font device dependent. Use pointSize to set the size of the font in a device independent manner.

\qmlproperty real QtQuick::TextInput::font.letterSpacing

Sets the letter spacing for the font.

Letter spacing changes the default spacing between individual letters in the font. A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.

\qmlproperty real QtQuick::TextInput::font.wordSpacing

Sets the word spacing for the font.

Word spacing changes the default spacing between individual words. A positive value increases the word spacing by a corresponding amount of pixels, while a negative value decreases the inter-word spacing accordingly.

\qmlproperty enumeration QtQuick::TextInput::font.capitalization

Sets the capitalization for the text.

\value Font.MixedCase the normal case: no capitalization change is applied \value Font.AllUppercase alters the text to be rendered in all uppercase type \value Font.AllLowercase alters the text to be rendered in all lowercase type \value Font.SmallCaps alters the text to be rendered in small-caps type \value Font.Capitalize alters the text to be rendered with the first character of each word as an uppercase character

\qml TextInput { text: "Hello"; font.capitalization: Font.AllLowercase } \endqml

\qmlproperty enumeration QtQuick::TextInput::font.hintingPreference

Since
5.8

Sets the preferred hinting on the text. This is a hint to the underlying text rendering system to use a certain level of hinting, and has varying support across platforms. See the table in the documentation for QFont::HintingPreference for more details.

Note
This property only has an effect when used together with render type TextInput.NativeRendering.

\value Font.PreferDefaultHinting Use the default hinting level for the target platform. \value Font.PreferNoHinting If possible, render text without hinting the outlines of the glyphs. The text layout will be typographically accurate, using the same metrics as are used e.g. when printing. \value Font.PreferVerticalHinting If possible, render text with no horizontal hinting, but align glyphs to the pixel grid in the vertical direction. The text will appear crisper on displays where the density is too low to give an accurate rendering of the glyphs. But since the horizontal metrics of the glyphs are unhinted, the text's layout will be scalable to higher density devices (such as printers) without impacting details such as line breaks. \value Font.PreferFullHinting If possible, render text with hinting in both horizontal and vertical directions. The text will be altered to optimize legibility on the target device, but since the metrics will depend on the target size of the text, the positions of glyphs, line breaks, and other typographical detail will not scale, meaning that a text layout may look different on devices with different pixel densities.

\qml TextInput { text: "Hello"; renderType: TextInput.NativeRendering; font.hintingPreference: Font.PreferVerticalHinting } \endqml

\qmlproperty bool QtQuick::TextInput::font.kerning

Since
5.10

Enables or disables the kerning OpenType feature when shaping the text. Disabling this may improve performance when creating or changing the text, at the expense of some cosmetic features. The default value is true.

\qml TextInput { text: "OATS FLAVOUR WAY"; font.kerning: false } \endqml

\qmlproperty bool QtQuick::TextInput::font.preferShaping

Since
5.10

Sometimes, a font will apply complex rules to a set of characters in order to display them correctly. In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, but in e.g. Latin script, it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features when they are not required, which will improve performance in most cases.

The default value is true.

\qml TextInput { text: "Some text"; font.preferShaping: false } \endqml

\qmlproperty object QtQuick::TextInput::font.variableAxes

Since
6.7

qml-font-variable-axes

\qmlproperty object QtQuick::TextInput::font.features

Since
6.6

qml-font-features

Definition at line 406 of file qquicktextinput.cpp.

References d.

◆ fontChanged

void QQuickTextInput::fontChanged ( const QFont & font)
signal

Referenced by setFont().

+ Here is the caller graph for this function:

◆ geometryChange()

void QQuickTextInput::geometryChange ( const QRectF & newGeometry,
const QRectF & oldGeometry )
overrideprotectedvirtual
Since
6.0

This function is called to handle this item's changes in geometry from oldGeometry to newGeometry. If the two geometries are the same, it doesn't do anything.

Derived classes must call the base class method within their implementation.

Reimplemented from QQuickItem.

Definition at line 1783 of file qquicktextinput.cpp.

References AlignTop, d, QQuickItem::geometryChange(), QRectF::height(), and QRectF::width().

Referenced by QQuickTextField::geometryChange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getText()

QString QQuickTextInput::getText ( int start,
int end ) const

\qmlmethod string QtQuick::TextInput::getText(int start, int end)

Returns the section of text that is between the start and end positions.

If the TextInput has an inputMask the length will include mask characters.

Definition at line 200 of file qquicktextinput.cpp.

References d, and qSwap().

+ Here is the call graph for this function:

◆ hAlign()

QQuickTextInput::HAlignment QQuickTextInput::hAlign ( ) const

\qmlproperty enumeration QtQuick::TextInput::effectiveHorizontalAlignment \readonly

When using the attached property LayoutMirroring::enabled to mirror application layouts, the horizontal alignment of text will also be mirrored. However, the property \l horizontalAlignment will remain unchanged. To query the effective horizontal alignment of TextInput, use the read-only property effectiveHorizontalAlignment.

\qmlproperty enumeration QtQuick::TextInput::horizontalAlignment \qmlproperty enumeration QtQuick::TextInput::verticalAlignment

Sets the horizontal alignment of the text within the TextInput item's width and height. By default, the text alignment follows the natural alignment of the text, for example text that is read from left to right will be aligned to the left.

TextInput does not have vertical alignment, as the natural height is exactly the height of the single line of text. If you set the height manually to something larger, TextInput will always be top aligned vertically. You can use anchors to align it however you want within another item.

The valid values for horizontalAlignment are TextInput.AlignLeft, TextInput.AlignRight and TextInput.AlignHCenter.

Valid values for verticalAlignment are TextInput.AlignTop (default), TextInput.AlignBottom TextInput.AlignVCenter.

When using the attached property LayoutMirroring::enabled to mirror application layouts, the horizontal alignment of text will also be mirrored. However, the property horizontalAlignment will remain unchanged. To query the effective horizontal alignment of TextInput, use the read-only property \l effectiveHorizontalAlignment.

Definition at line 549 of file qquicktextinput.cpp.

References d.

◆ hasAcceptableInput()

bool QQuickTextInput::hasAcceptableInput ( ) const

\qmlproperty bool QtQuick::TextInput::acceptableInput \readonly

This property is always true unless a validator or input mask has been set. If a validator or input mask has been set, this property will only be true if the current text is acceptable to the validator or input mask as a final string (not as an intermediate string).

Definition at line 1196 of file qquicktextinput.cpp.

References d.

◆ horizontalAlignmentChanged

void QQuickTextInput::horizontalAlignmentChanged ( QQuickTextInput::HAlignment alignment)
signal

◆ inputMask()

QString QQuickTextInput::inputMask ( ) const

\qmlproperty string QtQuick::TextInput::inputMask

Allows you to set an input mask on the TextInput, restricting the allowable text inputs. See QLineEdit::inputMask for further details, as the exact same mask strings are used by TextInput.

See also
acceptableInput, validator

Definition at line 1168 of file qquicktextinput.cpp.

References d.

◆ inputMaskChanged

void QQuickTextInput::inputMaskChanged ( const QString & inputMask)
signal

Referenced by setInputMask().

+ Here is the caller graph for this function:

◆ inputMethodComposingChanged

void QQuickTextInput::inputMethodComposingChanged ( )
signal

Referenced by QQuickComboBox::contentItemChange(), and QQuickSpinBox::contentItemChange().

+ Here is the caller graph for this function:

◆ inputMethodHints()

Qt::InputMethodHints QQuickTextInput::inputMethodHints ( ) const

\qmlproperty enumeration QtQuick::TextInput::inputMethodHints

Provides hints to the input method about the expected content of the text input and how it should operate.

The value is a bit-wise combination of flags, or Qt.ImhNone if no hints are set.

Flags that alter behaviour are:

\value Qt.ImhHiddenText Characters should be hidden, as is typically used when entering passwords. \value Qt.ImhSensitiveData Typed text should not be stored by the active input method in any persistent storage like predictive user dictionary. \value Qt.ImhNoAutoUppercase The input method should not try to automatically switch to upper case when a sentence ends. \value Qt.ImhPreferNumbers Numbers are preferred (but not required). \value Qt.ImhPreferUppercase Upper case letters are preferred (but not required). \value Qt.ImhPreferLowercase Lower case letters are preferred (but not required). \value Qt.ImhNoPredictiveText Do not use predictive text (i.e. dictionary lookup) while typing. \value Qt.ImhDate The text editor functions as a date field. \value Qt.ImhTime The text editor functions as a time field.

Flags that restrict input (exclusive flags) are:

\value Qt.ImhDigitsOnly Only digits are allowed. \value Qt.ImhFormattedNumbersOnly Only number input is allowed. This includes decimal point and minus sign. \value Qt.ImhUppercaseOnly Only upper case letter input is allowed. \value Qt.ImhLowercaseOnly Only lower case letter input is allowed. \value Qt.ImhDialableCharactersOnly Only characters suitable for phone dialing are allowed. \value Qt.ImhEmailCharactersOnly Only characters suitable for email addresses are allowed. \value Qt.ImhUrlCharactersOnly Only characters suitable for URLs are allowed.

Masks:

\value Qt.ImhExclusiveInputMask This mask yields nonzero if any of the exclusive flags are used.

Definition at line 1323 of file qquicktextinput.cpp.

References d, and Qt::ImhNone.

◆ inputMethodHintsChanged

void QQuickTextInput::inputMethodHintsChanged ( )
signal

Referenced by setInputMethodHints().

+ Here is the caller graph for this function:

◆ insert

void QQuickTextInput::insert ( int position,
const QString & text )
slot

\qmlmethod QtQuick::TextInput::insert(int position, string text)

Inserts text into the TextInput at position.

Definition at line 2250 of file qquicktextinput.cpp.

References QString::at(), d, QQuickTextInputPrivate::DeleteSelection, emit, i, QQuickTextInputPrivate::Insert, QString::isEmpty(), QString::left(), Password, QQuickItem::position(), selectionEndChanged(), selectionStartChanged(), QQuickTextInputPrivate::SetSelection, QString::size(), and text.

+ Here is the call graph for this function:

◆ invalidate()

void QQuickTextInput::invalidate ( )
overridevirtual

Implements QQuickTextInterface.

Definition at line 110 of file qquicktextinput.cpp.

References d.

◆ isCursorVisible()

bool QQuickTextInput::isCursorVisible ( ) const

\qmlproperty bool QtQuick::TextInput::cursorVisible Set to true when the TextInput shows a cursor.

This property is set and unset when the TextInput gets active focus, so that other properties can be bound to whether the cursor is currently showing. As it gets set and unset automatically, when you set the value yourself you must keep in mind that your value may be overwritten.

It can be set directly in script, for example if a KeyProxy might forward keys to it and you desire it to look active when this happens (but without actually giving it active focus).

It should not be set directly on the item, like in the below QML, as the specified value will be overridden and lost on focus changes.

TextInput {
text: "Text"
}

In the above snippet the cursor will still become visible when the TextInput gains active focus.

Definition at line 839 of file qquicktextinput.cpp.

References d.

Referenced by componentComplete().

+ Here is the caller graph for this function:

◆ isInputMethodComposing()

bool QQuickTextInput::isInputMethodComposing ( ) const

\qmlproperty bool QtQuick::TextInput::inputMethodComposing \readonly

This property holds whether the TextInput has partial text input from an input method.

While it is composing an input method may rely on mouse or key events from the TextInput to edit or commit the partial text. This property can be used to determine when to disable events handlers that may interfere with the correct operation of an input method.

Definition at line 2822 of file qquicktextinput.cpp.

References d.

◆ isReadOnly()

bool QQuickTextInput::isReadOnly ( ) const

\qmlproperty bool QtQuick::TextInput::readOnly

Sets whether user input can modify the contents of the TextInput.

If readOnly is set to true, then user input will not affect the text property. Any bindings or attempts to set the text property will still work.

Definition at line 756 of file qquicktextinput.cpp.

References d.

Referenced by updatePaintNode().

+ Here is the caller graph for this function:

◆ isRightToLeft

bool QQuickTextInput::isRightToLeft ( int start,
int end )
slot

\qmlmethod QtQuick::TextInput::isRightToLeft(int start, int end)

Returns true if the natural reading direction of the editor text found between positions start and end is right to left.

Definition at line 2153 of file qquicktextinput.cpp.

References QString::isRightToLeft(), QString::mid(), qmlWarning(), and text.

+ Here is the call graph for this function:

◆ itemChange()

void QQuickTextInput::itemChange ( ItemChange change,
const ItemChangeData & value )
overrideprotectedvirtual

Called when change occurs for this item.

value contains extra information relating to the change, when applicable.

If you re-implement this method in a subclass, be sure to call

virtual void itemChange(ItemChange, const ItemChangeData &)
Called when change occurs for this item.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]

typically at the end of your implementation, to ensure the \l windowChanged() signal will be emitted.

Reimplemented from QQuickItem.

Definition at line 1797 of file qquicktextinput.cpp.

References d, QQuickItem::itemChange(), QQuickItem::ItemDevicePixelRatioHasChanged, NativeRendering, and Q_UNUSED.

Referenced by QQuickTextField::itemChange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ keyPressEvent()

void QQuickTextInput::keyPressEvent ( QKeyEvent * event)
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to receive key press events for an item.

The event information is provided by the event parameter.

\input item.qdocinc accepting-events

Reimplemented from QQuickItem.

Definition at line 1524 of file qquicktextinput.cpp.

References cursorPosition, d, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right, Qt::Key_Up, QQuickItem::keyPressEvent(), Qt::LeftToRight, and Qt::NoModifier.

+ Here is the call graph for this function:

◆ leftPadding()

qreal QQuickTextInput::leftPadding ( ) const

Definition at line 4914 of file qquicktextinput.cpp.

References d.

◆ length()

int QQuickTextInput::length ( ) const

\qmlproperty int QtQuick::TextInput::length

Returns the total number of characters in the TextInput item.

If the TextInput has an inputMask the length will include mask characters and may differ from the length of the string returned by the \l text property.

This property can be faster than querying the length the \l text property as it doesn't require any copying or conversion of the TextInput's internal string data.

Definition at line 186 of file qquicktextinput.cpp.

References d.

◆ maximumLengthChanged

void QQuickTextInput::maximumLengthChanged ( int maximumLength)
signal

Referenced by setMaxLength().

+ Here is the caller graph for this function:

◆ maxLength()

int QQuickTextInput::maxLength ( ) const

\qmlproperty int QtQuick::TextInput::maximumLength The maximum permitted length of the text in the TextInput.

If the text is too long, it is truncated at the limit.

By default, this property contains a value of 32767.

Definition at line 795 of file qquicktextinput.cpp.

References d.

◆ mouseDoubleClickEvent()

void QQuickTextInput::mouseDoubleClickEvent ( QMouseEvent * event)
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to receive mouse double-click events for an item.

The event information is provided by the event parameter.

\input item.qdocinc accepting-events

Reimplemented from QQuickItem.

Definition at line 1561 of file qquicktextinput.cpp.

References cursor, d, QQuickDeliveryAgentPrivate::isEventFromMouseOrTouchpad(), Qt::LeftButton, and QQuickItem::mouseDoubleClickEvent().

Referenced by QQuickTextField::mouseDoubleClickEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mouseMoveEvent()

void QQuickTextInput::mouseMoveEvent ( QMouseEvent * event)
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to receive mouse move events for an item.

The event information is provided by the event parameter.

In order to receive mouse movement events, the preceding mouse press event must be accepted (by overriding \l mousePressEvent(), for example) and \l acceptedMouseButtons() must return the relevant mouse button.

\input item.qdocinc accepting-events

Reimplemented from QQuickItem.

Definition at line 1627 of file qquicktextinput.cpp.

References d, QQuickDeliveryAgentPrivate::isEventFromMouseOrTouchpad(), QQuickItem::mouseMoveEvent(), moveCursorSelection(), qAbs(), QT_VERSION, QT_VERSION_CHECK, QQuickItem::setKeepMouseGrab(), and QGuiApplication::styleHints().

Referenced by QQuickTextField::mouseMoveEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mousePressEvent()

void QQuickTextInput::mousePressEvent ( QMouseEvent * event)
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to receive mouse press events for an item.

The event information is provided by the event parameter.

In order to receive mouse press events, \l acceptedMouseButtons() must return the relevant mouse button.

\input item.qdocinc accepting-events

Reimplemented from QQuickItem.

Definition at line 1584 of file qquicktextinput.cpp.

References cursor, d, QQuickDeliveryAgentPrivate::isEventFromMouseOrTouchpad(), Qt::MouseFocusReason, qGuiApp, QT_VERSION, QT_VERSION_CHECK, selectAll(), QQuickItem::setKeepMouseGrab(), Qt::ShiftModifier, and QGuiApplication::styleHints().

Referenced by QQuickTextField::mouseDoubleClickEvent(), QQuickTextField::mouseMoveEvent(), QQuickTextField::mousePressEvent(), and QQuickTextField::mouseReleaseEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mouseReleaseEvent()

void QQuickTextInput::mouseReleaseEvent ( QMouseEvent * event)
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to receive mouse release events for an item.

The event information is provided by the event parameter.

In order to receive mouse release events, the preceding mouse press event must be accepted (by overriding \l mousePressEvent(), for example) and \l acceptedMouseButtons() must return the relevant mouse button.

\input item.qdocinc accepting-events

Reimplemented from QQuickItem.

Definition at line 1659 of file qquicktextinput.cpp.

References QGuiApplication::clipboard(), d, QQuickDeliveryAgentPrivate::isEventFromMouseOrTouchpad(), Qt::LeftButton, Qt::MiddleButton, Qt::MouseFocusReason, QQuickItem::mouseReleaseEvent(), qGuiApp, QClipboard::Selection, QQuickItem::setKeepMouseGrab(), and text.

Referenced by QQuickTextField::mouseReleaseEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mouseSelectionMode()

QQuickTextInput::SelectionMode QQuickTextInput::mouseSelectionMode ( ) const

\qmlproperty enumeration QtQuick::TextInput::mouseSelectionMode

Specifies how text should be selected using a mouse.

\value TextInput.SelectCharacters (default) The selection is updated with individual characters. \value TextInput.SelectWords The selection is updated with whole words.

This property only applies when \l selectByMouse is true.

Definition at line 2546 of file qquicktextinput.cpp.

References d.

◆ mouseSelectionModeChanged

void QQuickTextInput::mouseSelectionModeChanged ( QQuickTextInput::SelectionMode mode)
signal

Referenced by setMouseSelectionMode().

+ Here is the caller graph for this function:

◆ mouseUngrabEvent()

void QQuickTextInput::mouseUngrabEvent ( )
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to be notified when a mouse ungrab event has occurred on this item.

Reimplemented from QQuickItem.

Definition at line 1718 of file qquicktextinput.cpp.

References d, and QQuickItem::setKeepMouseGrab().

+ Here is the call graph for this function:

◆ moveCursorSelection() [1/2]

void QQuickTextInput::moveCursorSelection ( int pos)

Definition at line 2661 of file qquicktextinput.cpp.

References d, and QQuickItem::position().

Referenced by mouseMoveEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveCursorSelection() [2/2]

void QQuickTextInput::moveCursorSelection ( int pos,
SelectionMode mode )

\qmlmethod QtQuick::TextInput::moveCursorSelection(int position, SelectionMode mode)

Moves the cursor to position and updates the selection according to the optional mode parameter. (To only move the cursor, set the \l cursorPosition property.)

When this method is called it additionally sets either the selectionStart or the selectionEnd (whichever was at the previous cursor position) to the specified position. This allows you to easily extend and contract the selected text range.

The selection mode specifies whether the selection is updated on a per character or a per word basis. If not specified the selection mode will default to {TextInput.SelectCharacters}.

\value TextInput.SelectCharacters Sets either the selectionStart or selectionEnd (whichever was at the previous cursor position) to the specified position. \value TextInput.SelectWords Sets the selectionStart and selectionEnd to include all words between the specified position and the previous cursor position. Words partially in the range are included.

For example, take this sequence of calls:

moveCursorSelection(9, TextInput.SelectCharacters)
Q_INVOKABLE void moveCursorSelection(int pos)

This moves the cursor to position 5, extend the selection end from 5 to 9 and then retract the selection end from 9 to 7, leaving the text from position 5 to 7 selected (the 6th and 7th characters).

The same sequence with TextInput.SelectWords will extend the selection start to a word boundary before or on position 5 and extend the selection end to a word boundary on or past position 9.

Definition at line 2703 of file qquicktextinput.cpp.

References cursor, d, QTextBoundaryFinder::EndOfItem, QTextBoundaryFinder::NotAtBoundary, pos, SelectCharacters, QString::size(), QTextBoundaryFinder::StartOfItem, text, and QTextBoundaryFinder::Word.

+ Here is the call graph for this function:

◆ overwriteMode()

bool QQuickTextInput::overwriteMode ( ) const

\qmlproperty bool QtQuick::TextInput::overwriteMode

Since
5.8

Whether text entered by the user will overwrite existing text.

As with many text editors, the text editor widget can be configured to insert or overwrite existing text with new text entered by the user.

If this property is true, existing text is overwritten, character-for-character by new text; otherwise, text is inserted at the cursor position, displacing existing text.

By default, this property is false (new text does not overwrite existing text).

Definition at line 1509 of file qquicktextinput.cpp.

References d.

◆ overwriteModeChanged

void QQuickTextInput::overwriteModeChanged ( bool overwriteMode)
signal

Referenced by setOverwriteMode().

+ Here is the caller graph for this function:

◆ padding()

qreal QQuickTextInput::padding ( ) const
Since
5.6 \qmlproperty real QtQuick::TextInput::padding \qmlproperty real QtQuick::TextInput::topPadding \qmlproperty real QtQuick::TextInput::leftPadding \qmlproperty real QtQuick::TextInput::bottomPadding \qmlproperty real QtQuick::TextInput::rightPadding

These properties hold the padding around the content. This space is reserved in addition to the contentWidth and contentHeight.

The individual padding properties assume the value of the padding property unless they are set explicitly. For example, if padding is set to 4 and leftPadding to 8, 8 will be used as the left padding.

Note
If an explicit width or height is given to a TextInput, care must be taken to ensure it is large enough to accommodate the relevant padding values. For example: if topPadding and bottomPadding are set to 10, but the height of the TextInput is only set to 20, the text will not have enough vertical space in which to be rendered, and will appear clipped.

Definition at line 4863 of file qquicktextinput.cpp.

References d.

◆ passwordCharacter()

QString QQuickTextInput::passwordCharacter ( ) const

\qmlproperty string QtQuick::TextInput::passwordCharacter

This is the character displayed when echoMode is set to Password or PasswordEchoOnEdit. By default it is the password character used by the platform theme.

If this property is set to a string with more than one character, the first character is used. If the string is empty, the value is ignored and the property is not set.

Definition at line 2417 of file qquicktextinput.cpp.

References d.

◆ passwordCharacterChanged

void QQuickTextInput::passwordCharacterChanged ( )
signal

Referenced by setPasswordCharacter().

+ Here is the caller graph for this function:

◆ passwordMaskDelay()

int QQuickTextInput::passwordMaskDelay ( ) const

\qmlproperty int QtQuick::TextInput::passwordMaskDelay

Since
5.4

Sets the delay before visible character is masked with password character, in milliseconds.

The reset method will be called by assigning undefined.

Definition at line 2442 of file qquicktextinput.cpp.

References d.

◆ persistentSelection()

bool QQuickTextInput::persistentSelection ( ) const

\qmlproperty bool QtQuick::TextInput::persistentSelection

Whether the TextInput should keep its selection when it loses active focus to another item in the scene. By default this is set to false;

Definition at line 2568 of file qquicktextinput.cpp.

References d.

◆ persistentSelectionChanged

void QQuickTextInput::persistentSelectionChanged ( )
signal

Referenced by setPersistentSelection().

+ Here is the caller graph for this function:

◆ positionAt()

void QQuickTextInput::positionAt ( QQmlV4FunctionPtr args) const

\qmlmethod int QtQuick::TextInput::positionAt(real x, real y, CursorPosition position)

This function returns the character position at x and y pixels from the top left of the textInput. Position 0 is before the first character, position 1 is after the first character but before the second, and so on until position text.length, which is after all characters.

This means that for all x values before the first character this function returns 0, and for all x values after the last character this function returns text.length. If the y value is above the text the position will be that of the nearest character on the first line and if it is below the text the position of the nearest character on the last line will be returned.

The cursor position parameter specifies how the cursor position should be resolved:

\value TextInput.CursorBetweenCharacters Returns the position between characters that is nearest x. This is the default value. \value TextInput.CursorOnCharacter Returns the position before the character that is nearest x.

Definition at line 1437 of file qquicktextinput.cpp.

References arg, args, cursor, QTextLine::CursorBetweenCharacters, d, i, QList< T >::length(), length, pos, and QQuickItem::position().

+ Here is the call graph for this function:

◆ positionToRectangle()

QRectF QQuickTextInput::positionToRectangle ( int pos) const

\qmlmethod rect QtQuick::TextInput::positionToRectangle(int pos)

This function takes a character position pos and returns the rectangle that the cursor would occupy, if it was placed at that character position.

This is similar to setting the cursorPosition, and then querying the cursor rectangle, but the cursorPosition is not changed.

Definition at line 1390 of file qquicktextinput.cpp.

References QTextLine::cursorToX(), d, font, QTextLine::height(), QFontMetrics::horizontalAdvance(), QTextLine::isValid(), NoEcho, pos, QQuickItem::size(), text, QQuickItem::x, and QTextLine::y().

+ Here is the call graph for this function:

◆ Q_REVISION [1/12]

QQuickTextInput::Q_REVISION ( 2 ,
2  )
signal

◆ Q_REVISION [2/12]

QQuickTextInput::Q_REVISION ( 2 ,
4  )
slot

◆ Q_REVISION [3/12]

QQuickTextInput::Q_REVISION ( 2 ,
4  )
signal

◆ Q_REVISION [4/12]

QQuickTextInput::Q_REVISION ( 2 ,
6  )
signal

◆ Q_REVISION [5/12]

QQuickTextInput::Q_REVISION ( 2 ,
6  )
signal

◆ Q_REVISION [6/12]

QQuickTextInput::Q_REVISION ( 2 ,
6  )
signal

◆ Q_REVISION [7/12]

QQuickTextInput::Q_REVISION ( 2 ,
6  )
signal

◆ Q_REVISION [8/12]

QQuickTextInput::Q_REVISION ( 2 ,
6  )
signal

◆ Q_REVISION() [9/12]

QQuickTextInput::Q_REVISION ( 2 ,
7  ) const

◆ Q_REVISION [10/12]

QQuickTextInput::Q_REVISION ( 2 ,
7  )
slot

◆ Q_REVISION [11/12]

QQuickTextInput::Q_REVISION ( 2 ,
7  )
signal

◆ Q_REVISION [12/12]

QQuickTextInput::Q_REVISION ( 2 ,
9  )
signal

◆ readOnlyChanged

void QQuickTextInput::readOnlyChanged ( bool isReadOnly)
signal

Referenced by QQuickTextField::QQuickTextField(), QQuickStyleItemTextField::connectToControl(), and setReadOnly().

+ Here is the caller graph for this function:

◆ redo

void QQuickTextInput::redo ( )
slot

\qmlmethod QtQuick::TextInput::redo()

Redoes the last operation if redo is \l {canRedo}{available}.

Definition at line 2234 of file qquicktextinput.cpp.

References d.

◆ remove

void QQuickTextInput::remove ( int start,
int end )
slot

\qmlmethod QtQuick::TextInput::remove(int start, int end)

Removes the section of text that is between the start and end positions from the TextInput.

Definition at line 2323 of file qquicktextinput.cpp.

References d, QQuickTextInputPrivate::DeleteSelection, emit, i, QQuickTextInputPrivate::Insert, qBound(), qMin(), qSwap(), QQuickTextInputPrivate::RemoveSelection, selectionEndChanged(), selectionStartChanged(), and QQuickTextInputPrivate::SetSelection.

+ Here is the call graph for this function:

◆ renderType()

QQuickTextInput::RenderType QQuickTextInput::renderType ( ) const

\qmlproperty enumeration QtQuick::TextInput::renderType

Override the default rendering type for this component.

Supported render types are:

\value TextInput.QtRendering Text is rendered using a scalable distance field for each glyph. \value TextInput.NativeRendering Text is rendered using a platform-specific technique. \value TextInput.CurveRendering Text is rendered using a curve rasterizer running directly on the graphics hardware. (Introduced in Qt 6.7.0.)

Select TextInput.NativeRendering if you prefer text to look native on the target platform and do not require advanced features such as transformation of the text. Using such features in combination with the NativeRendering render type will lend poor and sometimes pixelated results.

Both TextInput.QtRendering and TextInput.CurveRendering are hardware-accelerated techniques. QtRendering is the faster of the two, but uses more memory and will exhibit rendering artifacts at large sizes. CurveRendering should be considered as an alternative in cases where QtRendering does not give good visual results or where reducing graphics memory consumption is a priority.

The default rendering type is determined by \l QQuickWindow::textRenderType().

Definition at line 155 of file qquicktextinput.cpp.

References d.

◆ renderTypeChanged

void QQuickTextInput::renderTypeChanged ( )
signal

Referenced by setRenderType().

+ Here is the caller graph for this function:

◆ resetBottomPadding()

void QQuickTextInput::resetBottomPadding ( )

Definition at line 4968 of file qquicktextinput.cpp.

References d.

◆ resetHAlign()

void QQuickTextInput::resetHAlign ( )

Definition at line 565 of file qquicktextinput.cpp.

References d, and QQuickItem::isComponentComplete().

+ Here is the call graph for this function:

◆ resetLeftPadding()

void QQuickTextInput::resetLeftPadding ( )

Definition at line 4928 of file qquicktextinput.cpp.

References d.

◆ resetPadding()

void QQuickTextInput::resetPadding ( )

Definition at line 4889 of file qquicktextinput.cpp.

◆ resetPasswordMaskDelay()

void QQuickTextInput::resetPasswordMaskDelay ( )

Definition at line 2457 of file qquicktextinput.cpp.

References qGuiApp, and setPasswordMaskDelay().

+ Here is the call graph for this function:

◆ resetRightPadding()

void QQuickTextInput::resetRightPadding ( )

Definition at line 4948 of file qquicktextinput.cpp.

References d.

◆ resetTopPadding()

void QQuickTextInput::resetTopPadding ( )

Definition at line 4908 of file qquicktextinput.cpp.

References d.

◆ rightPadding()

qreal QQuickTextInput::rightPadding ( ) const

Definition at line 4934 of file qquicktextinput.cpp.

References d.

◆ select

void QQuickTextInput::select ( int start,
int end )
slot

\qmlmethod QtQuick::TextInput::select(int start, int end)

Causes the text from start to end to be selected.

If either start or end is out of range, the selection is not changed.

After calling this, selectionStart will become the lesser and selectionEnd will become the greater (regardless of the order passed to this method).

See also
selectionStart, selectionEnd

Definition at line 969 of file qquicktextinput.cpp.

References d.

◆ selectAll

void QQuickTextInput::selectAll ( )
slot

\qmlmethod QtQuick::TextInput::selectAll()

Causes all text to be selected.

Definition at line 2141 of file qquicktextinput.cpp.

References d, QQuickItem::size(), and text.

Referenced by mousePressEvent(), and QQuickFolderBreadcrumbBarPrivate::toggleTextFieldVisibility().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selectByMouse()

bool QQuickTextInput::selectByMouse ( ) const

\qmlproperty bool QtQuick::TextInput::selectByMouse

Defaults to true.

If true, the user can use the mouse to select text in the usual way.

Note
In versions prior to 6.4, the default was false; but if you enabled this property, you could also select text on a touchscreen by dragging your finger across it. This interfered with flicking when TextInput was used inside a Flickable. For consistency with TextField, selectByMouse now really means what it says: if true, you can select text by dragging only with a mouse. If this change does not suit your application, you can set selectByMouse to false, or import an older API version (for example {import QtQuick 6.3}) to revert to the previous behavior. The option to revert behavior by changing the import version will be removed in a later version of Qt.

Definition at line 2520 of file qquicktextinput.cpp.

References d.

◆ selectByMouseChanged

void QQuickTextInput::selectByMouseChanged ( bool selectByMouse)
signal

Referenced by setSelectByMouse().

+ Here is the caller graph for this function:

◆ selectedText()

QString QQuickTextInput::selectedText ( ) const

\qmlproperty string QtQuick::TextInput::selectedText \readonly

This read-only property provides the text currently selected in the text input.

It is equivalent to the following snippet, but is faster and easier to use.

\qml myTextInput.text.toString().substring(myTextInput.selectionStart, myTextInput.selectionEnd); \endqml

Definition at line 992 of file qquicktextinput.cpp.

References d.

◆ selectedTextChanged

void QQuickTextInput::selectedTextChanged ( )
signal

◆ selectedTextColor()

QColor QQuickTextInput::selectedTextColor ( ) const

\qmlproperty color QtQuick::TextInput::selectedTextColor

The highlighted text color, used in selections.

Definition at line 492 of file qquicktextinput.cpp.

References d.

◆ selectedTextColorChanged

void QQuickTextInput::selectedTextColorChanged ( )
signal

Referenced by setSelectedTextColor().

+ Here is the caller graph for this function:

◆ selectionColor()

QColor QQuickTextInput::selectionColor ( ) const

\qmlproperty color QtQuick::TextInput::selectionColor

The text highlight color, used behind selections.

Definition at line 466 of file qquicktextinput.cpp.

References d.

◆ selectionColorChanged

void QQuickTextInput::selectionColorChanged ( )
signal

Referenced by setSelectionColor().

+ Here is the caller graph for this function:

◆ selectionEnd()

int QQuickTextInput::selectionEnd ( ) const

\qmlproperty int QtQuick::TextInput::selectionEnd

The cursor position after the last character in the current selection.

This property is read-only. To change the selection, use select(start,end), selectAll(), or selectWord().

\readonly

See also
selectionStart, cursorPosition, selectedText

Definition at line 951 of file qquicktextinput.cpp.

References d.

◆ selectionEndChanged

void QQuickTextInput::selectionEndChanged ( )
signal

Referenced by insert(), and remove().

+ Here is the caller graph for this function:

◆ selectionStart()

int QQuickTextInput::selectionStart ( ) const

\qmlproperty int QtQuick::TextInput::selectionStart

The cursor position before the first character in the current selection.

This property is read-only. To change the selection, use select(start,end), selectAll(), or selectWord().

\readonly

See also
selectionEnd, cursorPosition, selectedText

Definition at line 935 of file qquicktextinput.cpp.

References d.

◆ selectionStartChanged

void QQuickTextInput::selectionStartChanged ( )
signal

Referenced by insert(), and remove().

+ Here is the caller graph for this function:

◆ selectWord

void QQuickTextInput::selectWord ( )
slot

\qmlmethod QtQuick::TextInput::selectWord()

Causes the word closest to the current cursor position to be selected.

Definition at line 2400 of file qquicktextinput.cpp.

References d.

◆ setAutoScroll()

void QQuickTextInput::setAutoScroll ( bool b)

Definition at line 1034 of file qquicktextinput.cpp.

References autoScrollChanged(), d, and emit.

+ Here is the call graph for this function:

◆ setBottomPadding()

void QQuickTextInput::setBottomPadding ( qreal padding)

Definition at line 4962 of file qquicktextinput.cpp.

References d, and QQuickTextInputPrivate::padding().

+ Here is the call graph for this function:

◆ setColor()

void QQuickTextInput::setColor ( const QColor & c)

Definition at line 447 of file qquicktextinput.cpp.

References colorChanged(), d, emit, QQuickItem::polish(), QQuickItem::update(), and QQuickTextInputPrivate::UpdatePaintNode.

+ Here is the call graph for this function:

◆ setCursorDelegate()

void QQuickTextInput::setCursorDelegate ( QQmlComponent * c)

Definition at line 1368 of file qquicktextinput.cpp.

References d, and QQuickTextUtil::setCursorDelegate().

+ Here is the call graph for this function:

◆ setCursorPosition()

void QQuickTextInput::setCursorPosition ( int cp)

Definition at line 880 of file qquicktextinput.cpp.

References d, QQuickItem::size(), and text.

+ Here is the call graph for this function:

◆ setCursorVisible()

void QQuickTextInput::setCursorVisible ( bool on)

Definition at line 845 of file qquicktextinput.cpp.

References QQuickTextUtil::createCursor(), cursorVisibleChanged(), d, emit, and QQuickItem::isComponentComplete().

Referenced by QQuickDesignerSupportItems::disableTextCursor(), and setReadOnly().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setEchoMode()

void QQuickTextInput::setEchoMode ( QQuickTextInput::EchoMode echo)

Definition at line 1263 of file qquicktextinput.cpp.

References d, echoMode, echoModeChanged(), emit, Qt::ImHints, and Normal.

+ Here is the call graph for this function:

◆ setFocusOnPress()

void QQuickTextInput::setFocusOnPress ( bool b)

Definition at line 1010 of file qquicktextinput.cpp.

References activeFocusOnPressChanged(), d, and emit.

+ Here is the call graph for this function:

◆ setFont()

void QQuickTextInput::setFont ( const QFont & font)

Definition at line 412 of file qquicktextinput.cpp.

References d, emit, font, fontChanged(), Qt::ImAnchorRectangle, Qt::ImCursorRectangle, Qt::ImFont, and qRound().

+ Here is the call graph for this function:

◆ setHAlign()

void QQuickTextInput::setHAlign ( HAlignment align)

Definition at line 555 of file qquicktextinput.cpp.

References d, and QQuickItem::isComponentComplete().

+ Here is the call graph for this function:

◆ setInputMask()

void QQuickTextInput::setInputMask ( const QString & im)

Definition at line 1174 of file qquicktextinput.cpp.

References QString::append(), d, emit, inputMaskChanged(), and QString::lastIndexOf().

+ Here is the call graph for this function:

◆ setInputMethodHints()

void QQuickTextInput::setInputMethodHints ( Qt::InputMethodHints hints)

Definition at line 1333 of file qquicktextinput.cpp.

References d, emit, Qt::ImHints, inputMethodHintsChanged(), and Q_UNUSED.

+ Here is the call graph for this function:

◆ setLeftPadding()

void QQuickTextInput::setLeftPadding ( qreal padding)

Definition at line 4922 of file qquicktextinput.cpp.

References d, and QQuickTextInputPrivate::padding().

+ Here is the call graph for this function:

◆ setMaxLength()

void QQuickTextInput::setMaxLength ( int ml)

Definition at line 801 of file qquicktextinput.cpp.

References d, emit, and maximumLengthChanged().

+ Here is the call graph for this function:

◆ setMouseSelectionMode()

void QQuickTextInput::setMouseSelectionMode ( SelectionMode mode)

Definition at line 2552 of file qquicktextinput.cpp.

References d, emit, and mouseSelectionModeChanged().

+ Here is the call graph for this function:

◆ setOverwriteMode()

void QQuickTextInput::setOverwriteMode ( bool overwrite)

Definition at line 1515 of file qquicktextinput.cpp.

References d, emit, and overwriteModeChanged().

+ Here is the call graph for this function:

◆ setPadding()

void QQuickTextInput::setPadding ( qreal padding)

Definition at line 4869 of file qquicktextinput.cpp.

References d, emit, QQuickTextInputPrivate::padding(), and qFuzzyCompare().

+ Here is the call graph for this function:

◆ setPasswordCharacter()

void QQuickTextInput::setPasswordCharacter ( const QString & str)

Definition at line 2423 of file qquicktextinput.cpp.

References QString::constData(), d, emit, Password, passwordCharacterChanged(), PasswordEchoOnEdit, QString::size(), and str.

+ Here is the call graph for this function:

◆ setPasswordMaskDelay()

void QQuickTextInput::setPasswordMaskDelay ( int delay)

Definition at line 2448 of file qquicktextinput.cpp.

References d, and emit.

Referenced by resetPasswordMaskDelay().

+ Here is the caller graph for this function:

◆ setPersistentSelection()

void QQuickTextInput::setPersistentSelection ( bool persist)

Definition at line 2574 of file qquicktextinput.cpp.

References d, emit, and persistentSelectionChanged().

+ Here is the call graph for this function:

◆ setReadOnly()

void QQuickTextInput::setReadOnly ( bool ro)

Definition at line 762 of file qquicktextinput.cpp.

References d, emit, QQuickItem::hasActiveFocus(), Qt::ImEnabled, readOnlyChanged(), setCursorVisible(), QQuickItem::setFlag(), and QQuickItem::update().

+ Here is the call graph for this function:

◆ setRenderType()

void QQuickTextInput::setRenderType ( QQuickTextInput::RenderType renderType)

Definition at line 161 of file qquicktextinput.cpp.

References d, emit, QQuickItem::isComponentComplete(), renderType, and renderTypeChanged().

Referenced by QQuickDesignerSupportItems::disableNativeTextRendering().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRightPadding()

void QQuickTextInput::setRightPadding ( qreal padding)

Definition at line 4942 of file qquicktextinput.cpp.

References d, and QQuickTextInputPrivate::padding().

+ Here is the call graph for this function:

◆ setSelectByMouse()

void QQuickTextInput::setSelectByMouse ( bool on)

Definition at line 2526 of file qquicktextinput.cpp.

References d, emit, and selectByMouseChanged().

+ Here is the call graph for this function:

◆ setSelectedTextColor()

void QQuickTextInput::setSelectedTextColor ( const QColor & c)

Definition at line 498 of file qquicktextinput.cpp.

References color, d, emit, QQuickItem::polish(), selectedTextColorChanged(), QQuickItem::update(), and QQuickTextInputPrivate::UpdatePaintNode.

+ Here is the call graph for this function:

◆ setSelectionColor()

void QQuickTextInput::setSelectionColor ( const QColor & c)

Definition at line 472 of file qquicktextinput.cpp.

References color, d, emit, QQuickItem::polish(), selectionColorChanged(), QQuickItem::update(), and QQuickTextInputPrivate::UpdatePaintNode.

+ Here is the call graph for this function:

◆ setText()

void QQuickTextInput::setText ( const QString & s)

Definition at line 117 of file qquicktextinput.cpp.

References d, and text.

Referenced by QQuickFontDialogImplAttached::selectFontInListViews(), QQuickFolderBreadcrumbBarPrivate::toggleTextFieldVisibility(), and QQuickFileDialogImplPrivate::updateFileNameTextEdit().

+ Here is the caller graph for this function:

◆ setTopPadding()

void QQuickTextInput::setTopPadding ( qreal padding)

Definition at line 4902 of file qquicktextinput.cpp.

References d, and QQuickTextInputPrivate::padding().

+ Here is the call graph for this function:

◆ setVAlign()

void QQuickTextInput::setVAlign ( QQuickTextInput::VAlignment alignment)

Definition at line 686 of file qquicktextinput.cpp.

References alignment, d, emit, QQuickItem::isComponentComplete(), and verticalAlignmentChanged().

+ Here is the call graph for this function:

◆ setWrapMode()

void QQuickTextInput::setWrapMode ( WrapMode w)

Definition at line 725 of file qquicktextinput.cpp.

References d, emit, and wrapModeChanged().

+ Here is the call graph for this function:

◆ text()

QString QQuickTextInput::text ( ) const

\qmlproperty string QtQuick::TextInput::text

The text in the TextInput.

Note that some keyboards use a predictive function. In this case, the text being composed by the input method is not part of this property. The part of the text related to the predictions is underlined and stored in the \l preeditText property. To get whole text displayed in the TextInput use \l displayText property.

See also
clear(), displayText, preeditText

Definition at line 101 of file qquicktextinput.cpp.

References d, and QString::fromLatin1().

+ Here is the call graph for this function:

◆ textChanged

void QQuickTextInput::textChanged ( )
signal

Referenced by QQuickComboBox::contentItemChange(), QQuickSpinBox::contentItemChange(), QQuickComboBox::setEditable(), and QQuickFontDialogImplAttached::setSizeEdit().

+ Here is the caller graph for this function:

◆ timerEvent()

void QQuickTextInput::timerEvent ( QTimerEvent * event)
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to receive timer events for the object.

QChronoTimer provides higher-level interfaces to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.

See also
startTimer(), killTimer(), event()

Reimplemented from QObject.

Definition at line 4533 of file qquicktextinput.cpp.

References d, and QQuickTextInputPrivate::UpdatePaintNode.

Referenced by QQuickTextField::timerEvent().

+ Here is the caller graph for this function:

◆ topPadding()

qreal QQuickTextInput::topPadding ( ) const

Definition at line 4894 of file qquicktextinput.cpp.

References d.

◆ undo

void QQuickTextInput::undo ( )
slot

\qmlmethod QtQuick::TextInput::undo()

Undoes the last operation if undo is \l {canUndo}{available}. Deselects any current selection, and updates the selection start to the current cursor position.

Definition at line 2218 of file qquicktextinput.cpp.

References d.

◆ updatePaintNode()

QSGNode * QQuickTextInput::updatePaintNode ( QSGNode * oldNode,
UpdatePaintNodeData * updatePaintNodeData )
overrideprotectedvirtual

Called on the render thread when it is time to sync the state of the item with the scene graph.

The function is called as a result of QQuickItem::update(), if the user has set the QQuickItem::ItemHasContents flag on the item.

The function should return the root of the scene graph subtree for this item. Most implementations will return a single QSGGeometryNode containing the visual representation of this item. oldNode is the node that was returned the last time the function was called. updatePaintNodeData provides a pointer to the QSGTransformNode associated with this QQuickItem.

QSGNode *MyItem::updatePaintNode(QSGNode *node, UpdatePaintNodeData *)
{
QSGSimpleRectNode *n = static_cast<QSGSimpleRectNode *>(node);
if (!n) {
n->setColor(Qt::red);
}
n->setRect(boundingRect());
return n;
}
QRectF boundingRect() const override
Returns the extents of the item in its own coordinate system: a rectangle from {0,...
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
The QSGSimpleRectNode class is a convenience class for drawing solid filled rectangles using scenegra...
@ red
Definition qnamespace.h:35
GLfloat n

The main thread is blocked while this function is executed so it is safe to read values from the QQuickItem instance and other objects in the main thread.

If no call to QQuickItem::updatePaintNode() result in actual scene graph changes, like QSGNode::markDirty() or adding and removing nodes, then the underlying implementation may decide to not render the scene again as the visual outcome is identical.

Warning
It is crucial that graphics operations and interaction with the scene graph happens exclusively on the render thread, primarily during the QQuickItem::updatePaintNode() call. The best rule of thumb is to only use classes with the "QSG" prefix inside the QQuickItem::updatePaintNode() function.
This function is called on the render thread. This means any QObjects or thread local storage that is created will have affinity to the render thread, so apply caution when doing anything other than rendering in this function. Similarly for signals, these will be emitted on the render thread and will thus often be delivered via queued connections.
Note
All classes with QSG prefix should be used solely on the scene graph's rendering thread. See \l {Scene Graph and Rendering} for more information.
See also
QSGMaterial, QSGGeometryNode, QSGGeometry, QSGFlatColorMaterial, QSGTextureMaterial, QSGNode::markDirty(), {Graphics Resource Handling}

Reimplemented from QQuickItem.

Definition at line 1964 of file qquicktextinput.cpp.

References QSGTextNode::addTextLayout(), QSGInternalTextNode::clear(), QSGInternalTextNode::clearCursor(), clipRect(), cursorRectangle, d, QQuickItem::flags(), isReadOnly(), QQuickItem::ItemObservesViewport, leftPadding, QSGTexture::Linear, QSGTexture::Nearest, QSGTextNode::Normal, Q_UNUSED, QT_CONFIG, QSGInternalTextNode::setColor(), QSGInternalTextNode::setCursor(), QSGInternalTextNode::setFiltering(), QSGTransformNode::setMatrix(), QSGInternalTextNode::setRenderType(), QSGInternalTextNode::setSelectionColor(), QSGInternalTextNode::setSelectionTextColor(), QSGInternalTextNode::setTextStyle(), QSGInternalTextNode::setViewport(), QQuickItem::smooth, topPadding, QQuickTextInputPrivate::UpdateNone, and QQuickTextInputPrivate::UpdatePaintNode.

Referenced by QQuickTextField::updatePaintNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updatePolish()

void QQuickTextInput::updatePolish ( )
overrideprotectedvirtual

This function should perform any layout as required for this item.

When polish() is called, the scene graph schedules a polish event for this item. When the scene graph is ready to render this item, it calls updatePolish() to do any item layout as required before it renders the next frame.

See also
ensurePolished()

Reimplemented from QQuickItem.

Definition at line 1937 of file qquicktextinput.cpp.

◆ vAlign()

QQuickTextInput::VAlignment QQuickTextInput::vAlign ( ) const

Definition at line 680 of file qquicktextinput.cpp.

References d.

◆ verticalAlignmentChanged

void QQuickTextInput::verticalAlignmentChanged ( QQuickTextInput::VAlignment alignment)
signal

Referenced by setVAlign().

+ Here is the caller graph for this function:

◆ wrapMode()

QQuickTextInput::WrapMode QQuickTextInput::wrapMode ( ) const

\qmlproperty enumeration QtQuick::TextInput::wrapMode

Set this property to wrap the text to the TextInput item's width. The text will only wrap if an explicit width has been set.

\value TextInput.NoWrap (default) no wrapping will be performed. If the text contains insufficient newlines, then \l contentWidth will exceed a set width. \value TextInput.WordWrap wrapping is done on word boundaries only. If a word is too long, \l contentWidth will exceed a set width. \value TextInput.WrapAnywhere wrapping is done at any point on a line, even if it occurs in the middle of a word. \value TextInput.Wrap if possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.

The default is TextInput.NoWrap. If you set a width, consider using TextInput.Wrap.

Definition at line 719 of file qquicktextinput.cpp.

References d.

◆ wrapModeChanged

void QQuickTextInput::wrapModeChanged ( )
signal

Referenced by setWrapMode().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QQuickTextUtil

friend class QQuickTextUtil
friend

Definition at line 402 of file qquicktextinput_p.h.

Property Documentation

◆ acceptableInput

bool QQuickTextInput::acceptableInput
read

Definition at line 61 of file qquicktextinput_p.h.

◆ activeFocusOnPress

bool QQuickTextInput::activeFocusOnPress
readwrite

Definition at line 63 of file qquicktextinput_p.h.

◆ autoScroll

bool QQuickTextInput::autoScroll
readwrite

Definition at line 68 of file qquicktextinput_p.h.

◆ bottomPadding

qreal QQuickTextInput::bottomPadding
readwrite

Definition at line 84 of file qquicktextinput_p.h.

Referenced by QQuickTextField::updatePaintNode().

◆ canPaste

bool QQuickTextInput::canPaste
read

Definition at line 72 of file qquicktextinput_p.h.

Referenced by canPaste().

◆ canRedo

bool QQuickTextInput::canRedo
read

Definition at line 74 of file qquicktextinput_p.h.

◆ canUndo

bool QQuickTextInput::canUndo
read

Definition at line 73 of file qquicktextinput_p.h.

◆ color

QColor QQuickTextInput::color
readwrite

◆ contentHeight

qreal QQuickTextInput::contentHeight
read

Definition at line 77 of file qquicktextinput_p.h.

◆ contentWidth

qreal QQuickTextInput::contentWidth
read

Definition at line 76 of file qquicktextinput_p.h.

◆ cursorDelegate

QQmlComponent * QQuickTextInput::cursorDelegate
readwrite

Definition at line 48 of file qquicktextinput_p.h.

◆ cursorPosition

int QQuickTextInput::cursorPosition
readwrite

Definition at line 46 of file qquicktextinput_p.h.

Referenced by keyPressEvent().

◆ cursorRectangle

QRectF QQuickTextInput::cursorRectangle
read

Definition at line 47 of file qquicktextinput_p.h.

Referenced by updatePaintNode().

◆ cursorVisible

bool QQuickTextInput::cursorVisible
readwrite

Definition at line 45 of file qquicktextinput_p.h.

◆ displayText

QString QQuickTextInput::displayText
read

Definition at line 66 of file qquicktextinput_p.h.

◆ echoMode

EchoMode QQuickTextInput::echoMode
readwrite

Definition at line 62 of file qquicktextinput_p.h.

Referenced by setEchoMode().

◆ effectiveHorizontalAlignment

HAlignment QQuickTextInput::effectiveHorizontalAlignment
read

Definition at line 40 of file qquicktextinput_p.h.

◆ font

QFont QQuickTextInput::font
readwrite

◆ horizontalAlignment

HAlignment QQuickTextInput::horizontalAlignment
readwrite

Definition at line 39 of file qquicktextinput_p.h.

◆ inputMask

QString QQuickTextInput::inputMask
readwrite

Definition at line 58 of file qquicktextinput_p.h.

◆ inputMethodComposing

bool QQuickTextInput::inputMethodComposing
read

Definition at line 75 of file qquicktextinput_p.h.

◆ inputMethodHints

Qt::InputMethodHints QQuickTextInput::inputMethodHints
readwrite

Definition at line 59 of file qquicktextinput_p.h.

◆ leftPadding

qreal QQuickTextInput::leftPadding
readwrite

◆ length

int QQuickTextInput::length
read

Definition at line 34 of file qquicktextinput_p.h.

Referenced by positionAt().

◆ maximumLength

int QQuickTextInput::maximumLength
readwrite

Definition at line 54 of file qquicktextinput_p.h.

◆ mouseSelectionMode

SelectionMode QQuickTextInput::mouseSelectionMode
readwrite

Definition at line 70 of file qquicktextinput_p.h.

◆ overwriteMode

bool QQuickTextInput::overwriteMode
readwrite

Definition at line 49 of file qquicktextinput_p.h.

◆ padding

qreal QQuickTextInput::padding
readwrite

Definition at line 80 of file qquicktextinput_p.h.

◆ passwordCharacter

QString QQuickTextInput::passwordCharacter
readwrite

Definition at line 64 of file qquicktextinput_p.h.

◆ passwordMaskDelay

int QQuickTextInput::passwordMaskDelay
readwrite

Definition at line 65 of file qquicktextinput_p.h.

◆ persistentSelection

bool QQuickTextInput::persistentSelection
readwrite

Definition at line 71 of file qquicktextinput_p.h.

◆ preeditText

QString QQuickTextInput::preeditText
read

\qmlproperty string QtQuick::TextInput::preeditText \readonly

Since
5.7

This property contains partial text input from an input method.

To turn off partial text that results from predictions, set the Qt.ImhNoPredictiveText flag in inputMethodHints.

See also
displayText, inputMethodHints

Definition at line 67 of file qquicktextinput_p.h.

◆ readOnly

bool QQuickTextInput::readOnly
readwrite

Definition at line 44 of file qquicktextinput_p.h.

◆ renderType

RenderType QQuickTextInput::renderType
readwrite

Definition at line 78 of file qquicktextinput_p.h.

Referenced by setRenderType().

◆ rightPadding

qreal QQuickTextInput::rightPadding
readwrite

Definition at line 83 of file qquicktextinput_p.h.

Referenced by QQuickTextField::updatePaintNode().

◆ selectByMouse

bool QQuickTextInput::selectByMouse
readwrite

Definition at line 69 of file qquicktextinput_p.h.

◆ selectedText

QString QQuickTextInput::selectedText
read

Definition at line 52 of file qquicktextinput_p.h.

◆ selectedTextColor

QColor QQuickTextInput::selectedTextColor
readwrite

Definition at line 37 of file qquicktextinput_p.h.

◆ selectionColor

QColor QQuickTextInput::selectionColor
readwrite

Definition at line 36 of file qquicktextinput_p.h.

◆ selectionEnd

int QQuickTextInput::selectionEnd
read

Definition at line 51 of file qquicktextinput_p.h.

◆ selectionStart

int QQuickTextInput::selectionStart
read

Definition at line 50 of file qquicktextinput_p.h.

◆ text

◆ topPadding

qreal QQuickTextInput::topPadding
readwrite

◆ verticalAlignment

VAlignment QQuickTextInput::verticalAlignment
readwrite

Definition at line 41 of file qquicktextinput_p.h.

◆ wrapMode

WrapMode QQuickTextInput::wrapMode
readwrite

Definition at line 42 of file qquicktextinput_p.h.


The documentation for this class was generated from the following files: