![]() |
Qt 6.x
The Qt SDK
|
#include <qquicktextedit_p.h>
Public Slots | |
void | selectAll () |
\qmlmethod QtQuick::TextEdit::selectAll() | |
void | selectWord () |
\qmlmethod QtQuick::TextEdit::selectWord() | |
void | select (int start, int end) |
\qmlmethod QtQuick::TextEdit::select(int start, int end) | |
void | deselect () |
\qmlmethod QtQuick::TextEdit::deselect() | |
bool | isRightToLeft (int start, int end) |
\qmlmethod QtQuick::TextEdit::isRightToLeft(int start, int end) | |
void | undo () |
\qmlmethod QtQuick::TextEdit::undo() | |
void | redo () |
\qmlmethod QtQuick::TextEdit::redo() | |
void | insert (int position, const QString &text) |
\qmlmethod QtQuick::TextEdit::insert(int position, string text) | |
void | remove (int start, int end) |
\qmlmethod string QtQuick::TextEdit::remove(int start, int end) | |
Q_REVISION (2, 2) void append(const QString &text) | |
Q_REVISION (2, 7) void clear() | |
![]() | |
void | update () |
Schedules a call to updatePaintNode() for this item. | |
![]() | |
void | deleteLater () |
\threadsafe | |
Public Member Functions | |
QQuickTextEdit (QQuickItem *parent=nullptr) | |
QString | text () const |
void | setText (const QString &) |
\qmlproperty string QtQuick::TextEdit::font.family | |
Q_REVISION (2, 7) QString preeditText() const | |
TextFormat | textFormat () const |
\qmlproperty enumeration QtQuick::TextEdit::textFormat | |
void | setTextFormat (TextFormat format) |
QFont | font () const |
void | setFont (const QFont &font) |
QColor | color () const |
void | setColor (const QColor &c) |
QColor | selectionColor () const |
\qmlproperty color QtQuick::TextEdit::selectionColor | |
void | setSelectionColor (const QColor &c) |
QColor | selectedTextColor () const |
\qmlproperty color QtQuick::TextEdit::selectedTextColor | |
void | setSelectedTextColor (const QColor &c) |
HAlignment | hAlign () const |
\qmlproperty enumeration QtQuick::TextEdit::horizontalAlignment \qmlproperty enumeration QtQuick::TextEdit::verticalAlignment \qmlproperty enumeration QtQuick::TextEdit::effectiveHorizontalAlignment | |
void | setHAlign (HAlignment align) |
void | resetHAlign () |
HAlignment | effectiveHAlign () const |
VAlignment | vAlign () const |
void | setVAlign (VAlignment align) |
WrapMode | wrapMode () const |
\qmlproperty enumeration QtQuick::TextEdit::wrapMode | |
void | setWrapMode (WrapMode w) |
int | lineCount () const |
\qmlproperty int QtQuick::TextEdit::lineCount | |
int | length () const |
\qmlproperty int QtQuick::TextEdit::length | |
bool | isCursorVisible () const |
\qmlproperty bool QtQuick::TextEdit::cursorVisible If true the text edit shows a cursor. | |
void | setCursorVisible (bool on) |
int | cursorPosition () const |
\qmlproperty int QtQuick::TextEdit::cursorPosition The position of the cursor in the TextEdit. | |
void | setCursorPosition (int pos) |
QQmlComponent * | cursorDelegate () const |
\qmlproperty Component QtQuick::TextEdit::cursorDelegate The delegate for the cursor in the TextEdit. | |
void | setCursorDelegate (QQmlComponent *) |
bool | overwriteMode () const |
\qmlproperty bool QtQuick::TextEdit::overwriteMode | |
void | setOverwriteMode (bool overwrite) |
int | selectionStart () const |
\qmlproperty int QtQuick::TextEdit::selectionStart | |
int | selectionEnd () const |
\qmlproperty int QtQuick::TextEdit::selectionEnd | |
QString | selectedText () const |
\qmlproperty string QtQuick::TextEdit::selectedText | |
bool | focusOnPress () const |
\qmlproperty bool QtQuick::TextEdit::activeFocusOnPress | |
void | setFocusOnPress (bool on) |
bool | persistentSelection () const |
\qmlproperty bool QtQuick::TextEdit::persistentSelection | |
void | setPersistentSelection (bool on) |
qreal | textMargin () const |
\qmlproperty real QtQuick::TextEdit::textMargin | |
void | setTextMargin (qreal margin) |
Qt::InputMethodHints | inputMethodHints () const |
\qmlproperty enumeration QtQuick::TextEdit::inputMethodHints | |
void | setInputMethodHints (Qt::InputMethodHints hints) |
bool | selectByKeyboard () const |
\qmlproperty bool QtQuick::TextEdit::selectByKeyboard | |
void | setSelectByKeyboard (bool) |
bool | selectByMouse () const |
\qmlproperty bool QtQuick::TextEdit::selectByMouse | |
void | setSelectByMouse (bool) |
SelectionMode | mouseSelectionMode () const |
\qmlproperty enumeration QtQuick::TextEdit::mouseSelectionMode | |
void | setMouseSelectionMode (SelectionMode mode) |
bool | canPaste () const |
\qmlproperty bool QtQuick::TextEdit::canPaste | |
bool | canUndo () const |
\qmlproperty bool QtQuick::TextEdit::canUndo | |
bool | canRedo () const |
\qmlproperty bool QtQuick::TextEdit::canRedo | |
void | componentComplete () override |
Ensures any delayed caching or data loading the class needs to performed is complete. | |
void | setReadOnly (bool) |
\qmlproperty bool QtQuick::TextEdit::readOnly | |
bool | isReadOnly () const |
QRectF | cursorRectangle () const |
\qmlproperty rectangle QtQuick::TextEdit::cursorRectangle | |
qreal | contentWidth () const |
\qmlproperty real QtQuick::TextEdit::contentWidth | |
qreal | contentHeight () const |
\qmlproperty real QtQuick::TextEdit::contentHeight | |
QUrl | baseUrl () const |
\qmlproperty url QtQuick::TextEdit::baseUrl | |
void | setBaseUrl (const QUrl &url) |
void | resetBaseUrl () |
Q_INVOKABLE QRectF | positionToRectangle (int) const |
\qmlmethod rectangle QtQuick::TextEdit::positionToRectangle(position) | |
Q_INVOKABLE int | positionAt (qreal x, qreal y) const |
\qmlmethod int QtQuick::TextEdit::positionAt(int x, int y) | |
Q_INVOKABLE void | moveCursorSelection (int pos) |
\qmlmethod QtQuick::TextEdit::moveCursorSelection(int position, SelectionMode mode) | |
Q_INVOKABLE void | moveCursorSelection (int pos, SelectionMode mode) |
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 | isInputMethodComposing () const |
\qmlproperty bool QtQuick::TextEdit::inputMethodComposing | |
RenderType | renderType () const |
\qmlproperty enumeration QtQuick::TextEdit::renderType | |
void | setRenderType (RenderType renderType) |
Q_INVOKABLE QString | getText (int start, int end) const |
\qmlmethod string QtQuick::TextEdit::getText(int start, int end) | |
Q_INVOKABLE QString | getFormattedText (int start, int end) const |
\qmlmethod string QtQuick::TextEdit::getFormattedText(int start, int end) | |
QQuickTextDocument * | textDocument () |
QString | hoveredLink () const |
\qmlsignal QtQuick::TextEdit::linkHovered(string link) | |
Q_REVISION (2, 3) Q_INVOKABLE QString linkAt(qreal x | |
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 () |
int | tabStopDistance () const |
\qmlproperty real QtQuick::TextEdit::tabStopDistance | |
void | setTabStopDistance (qreal distance) |
void | invalidate () override |
![]() | |
QQuickItem (QQuickItem *parent=nullptr) | |
Constructs a QQuickItem with the given parent. | |
~QQuickItem () override | |
Destroys the QQuickItem. | |
QQuickWindow * | window () const |
Returns the window in which this item is rendered. | |
QQuickItem * | parentItem () 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< QQuickTransform > | transform () |
qreal | x () const |
qreal | y () const |
QPointF | position () const |
void | setX (qreal) |
void | setY (qreal) |
void | setPosition (const QPointF &) |
QBindable< qreal > | bindableX () |
QBindable< qreal > | bindableY () |
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< qreal > | bindableWidth () |
qreal | height () const |
void | setHeight (qreal) |
void | resetHeight () |
void | setImplicitHeight (qreal) |
qreal | implicitHeight () const |
QBindable< qreal > | bindableHeight () |
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. | |
virtual QRectF | boundingRect () const |
Returns the extents of the item in its own coordinate system: a rectangle from {0, 0} to \l width() and \l height(). | |
virtual QRectF | clipRect () const |
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(). | |
QQuickItem * | viewportItem () 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. | |
QQuickItem * | scopedFocusItem () const |
If this item is a focus scope, this returns the item in its focus chain that currently has focus. | |
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< QQuickItemGrabResult > | grabToImage (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) | |
QObject * | containmentMask () 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 QQuickItem * | childAt (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 QSGTextureProvider * | textureProvider () const |
Returns the texture provider for an item. | |
![]() | |
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 | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
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< QString > | bindableObjectName () |
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). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. | |
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::milliseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
template<typename T > | |
T | findChild (const QString &aName=QString(), 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 (const QString &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 > | |
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 QObjectList & | children () 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< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () 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 . | |
![]() | |
QQmlParserStatus () | |
virtual | ~QQmlParserStatus () |
virtual void | classBegin ()=0 |
Invoked after class creation, but before any properties have been set. | |
virtual void | componentComplete ()=0 |
Invoked after the root component that caused this instantiation has completed construction. | |
virtual void | invalidate ()=0 |
Public Attributes | |
qreal y | const |
![]() | |
const QSize & | targetSize = QSize()) |
qreal y | const |
Protected Member Functions | |
QQuickTextEdit (QQuickTextEditPrivate &dd, QQuickItem *parent=nullptr) | |
void | geometryChange (const QRectF &newGeometry, const QRectF &oldGeometry) override |
bool | event (QEvent *) override |
\reimp | |
void | keyPressEvent (QKeyEvent *) override |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given key event. | |
void | keyReleaseEvent (QKeyEvent *) override |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given key event. | |
void | focusInEvent (QFocusEvent *event) override |
This event handler can be reimplemented in a subclass to receive focus-in events for an item. | |
void | focusOutEvent (QFocusEvent *event) override |
This event handler can be reimplemented in a subclass to receive focus-out events for an item. | |
void | hoverEnterEvent (QHoverEvent *event) override |
This event handler can be reimplemented in a subclass to receive hover-enter events for an item. | |
void | hoverMoveEvent (QHoverEvent *event) override |
This event handler can be reimplemented in a subclass to receive hover-move events for an item. | |
void | hoverLeaveEvent (QHoverEvent *event) override |
This event handler can be reimplemented in a subclass to receive hover-leave events for an item. | |
void | mousePressEvent (QMouseEvent *event) override |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event. | |
void | mouseReleaseEvent (QMouseEvent *event) override |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event. | |
void | mouseDoubleClickEvent (QMouseEvent *event) override |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event. | |
void | mouseMoveEvent (QMouseEvent *event) override |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event. | |
QSGNode * | updatePaintNode (QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) override |
Called on the render thread when it is time to sync the state of the item with the scene graph. | |
void | updatePolish () override |
This function should perform any layout as required for this item. | |
![]() | |
QQuickImplicitSizeItem (QQuickImplicitSizeItemPrivate &dd, QQuickItem *parent) | |
![]() | |
bool | event (QEvent *) override |
\reimp | |
bool | isComponentComplete () const |
Returns true if construction of the QML component is complete; otherwise returns false. | |
virtual void | itemChange (ItemChange, const ItemChangeData &) |
Called when change occurs for this item. | |
virtual void | geometryChange (const QRectF &newGeometry, const QRectF &oldGeometry) |
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. | |
void | componentComplete () override |
\reimp Derived classes should call the base class method before adding their own actions to perform at componentComplete. | |
virtual void | keyPressEvent (QKeyEvent *event) |
This event handler can be reimplemented in a subclass to receive key press events for an item. | |
virtual void | keyReleaseEvent (QKeyEvent *event) |
This event handler can be reimplemented in a subclass to receive key release events for an item. | |
virtual void | focusInEvent (QFocusEvent *) |
This event handler can be reimplemented in a subclass to receive focus-in events for an item. | |
virtual void | focusOutEvent (QFocusEvent *) |
This event handler can be reimplemented in a subclass to receive focus-out events for an item. | |
virtual void | mousePressEvent (QMouseEvent *event) |
This event handler can be reimplemented in a subclass to receive mouse press events for an item. | |
virtual void | mouseMoveEvent (QMouseEvent *event) |
This event handler can be reimplemented in a subclass to receive mouse move events for an item. | |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
This event handler can be reimplemented in a subclass to receive mouse release events for an item. | |
virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
This event handler can be reimplemented in a subclass to receive mouse double-click events for an item. | |
virtual void | mouseUngrabEvent () |
This event handler can be reimplemented in a subclass to be notified when a mouse ungrab event has occurred on this 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 QSGNode * | updatePaintNode (QSGNode *, UpdatePaintNodeData *) |
Called on the render thread when it is time to sync the state of the item with the scene graph. | |
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(). | |
virtual void | updatePolish () |
This function should perform any layout as required for this item. | |
QQuickItem (QQuickItemPrivate &dd, QQuickItem *parent=nullptr) | |
![]() | |
QObject * | sender () 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 | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
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 |
QColor | color |
QColor | selectionColor |
QColor | selectedTextColor |
QFont | font |
HAlignment | horizontalAlignment |
HAlignment | effectiveHorizontalAlignment |
VAlignment | verticalAlignment |
WrapMode | wrapMode |
int | lineCount |
int | length |
qreal | contentWidth |
qreal | contentHeight |
qreal | paintedWidth |
qreal | paintedHeight |
TextFormat | textFormat |
bool | readOnly |
bool | cursorVisible |
int | cursorPosition |
QRectF | cursorRectangle |
QQmlComponent * | cursorDelegate |
bool | overwriteMode |
int | selectionStart |
int | selectionEnd |
QString | selectedText |
bool | activeFocusOnPress |
bool | persistentSelection |
qreal | textMargin |
Qt::InputMethodHints | inputMethodHints |
bool | selectByKeyboard |
FINALbool | selectByMouse |
SelectionMode | mouseSelectionMode |
bool | canPaste |
bool | canUndo |
bool | canRedo |
bool | inputMethodComposing |
QUrl | baseUrl |
RenderType | renderType |
QQuickTextDocument * | textDocument |
\qmlproperty TextDocument QtQuick::TextEdit::textDocument | |
QString | hoveredLink |
FINALqreal | padding |
FINALqreal | topPadding |
FINALqreal | leftPadding |
FINALqreal | rightPadding |
FINALqreal | bottomPadding |
FINALQString | preeditText |
\qmlproperty string QtQuick::TextEdit::preeditText \readonly | |
FINALqreal | tabStopDistance |
![]() | |
qreal | implicitWidth |
qreal | implicitHeight |
![]() | |
QQuickItem * | parent |
\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 | |
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< QQuickTransform > | transform |
\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 |
QObject * | containmentMask |
\qmlproperty QObject* QtQuick::Item::containmentMask | |
![]() | |
QString | objectName |
the name of this object | |
Friends | |
class | QQuickTextUtil |
class | QQuickTextDocument |
Additional Inherited Members | |
![]() | |
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) |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Definition at line 29 of file qquicktextedit_p.h.
Enumerator | |
---|---|
AlignLeft | |
AlignRight | |
AlignHCenter | |
AlignJustify |
Definition at line 89 of file qquicktextedit_p.h.
Enumerator | |
---|---|
QtRendering | |
NativeRendering |
Definition at line 126 of file qquicktextedit_p.h.
Enumerator | |
---|---|
SelectCharacters | |
SelectWords |
Definition at line 120 of file qquicktextedit_p.h.
Enumerator | |
---|---|
PlainText | |
RichText | |
AutoText | |
MarkdownText |
Definition at line 104 of file qquicktextedit_p.h.
Enumerator | |
---|---|
AlignTop | |
AlignBottom | |
AlignVCenter |
Definition at line 97 of file qquicktextedit_p.h.
Enumerator | |
---|---|
NoWrap | |
WordWrap | |
WrapAnywhere | |
WrapAtWordBoundaryOrAnywhere | |
Wrap |
Definition at line 112 of file qquicktextedit_p.h.
QQuickTextEdit::QQuickTextEdit | ( | QQuickItem * | parent = nullptr | ) |
Definition at line 138 of file qquicktextedit.cpp.
References d.
|
protected |
Definition at line 145 of file qquicktextedit.cpp.
References d.
|
signal |
QUrl QQuickTextEdit::baseUrl | ( | ) | const |
\qmlproperty url QtQuick::TextEdit::baseUrl
This property specifies a base URL which is used to resolve relative URLs within the text.
The default value is the url of the QML file instantiating the TextEdit item.
Definition at line 1039 of file qquicktextedit.cpp.
References baseUrl, context, d, and qmlContext().
|
signal |
qreal QQuickTextEdit::bottomPadding | ( | ) | const |
Definition at line 3316 of file qquicktextedit.cpp.
References d.
|
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 2619 of file qquicktextedit.cpp.
References QQuickTextUtil::alignedX(), and d.
bool QQuickTextEdit::canPaste | ( | ) | const |
|
signal |
bool QQuickTextEdit::canRedo | ( | ) | const |
\qmlproperty bool QtQuick::TextEdit::canRedo
Returns true if the TextEdit is writable and there are \l {undo}{undone} operations that can be redone.
Definition at line 2400 of file qquicktextedit.cpp.
References d.
|
signal |
bool QQuickTextEdit::canUndo | ( | ) | const |
\qmlproperty bool QtQuick::TextEdit::canUndo
Returns true if the TextEdit is writable and there are previous operations that can be undone.
Definition at line 2387 of file qquicktextedit.cpp.
References d.
|
signal |
|
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.
Reimplemented from QQuickItem.
Definition at line 2640 of file qquicktextedit.cpp.
References QQuickItem::clipRect(), and d.
Referenced by updatePaintNode().
QColor QQuickTextEdit::color | ( | ) | const |
\qmlproperty color QtQuick::TextEdit::color The text color. \qml
green text using hexadecimal notation TextEdit { color: "#00FF00" } \endqml
\qml steelblue text using SVG color name TextEdit { color: "steelblue" } \endqml
Definition at line 612 of file qquicktextedit.cpp.
References d.
|
overridevirtual |
Ensures any delayed caching or data loading the class needs to performed is complete.
Reimplemented from QQuickItem.
Definition at line 1507 of file qquicktextedit.cpp.
References baseUrl, QQmlParserStatus::componentComplete(), context, QQuickTextUtil::createCursor(), d, isCursorVisible(), QQuickItem::polish(), qmlContext(), and url.
Referenced by QQuickTextArea::componentComplete().
qreal QQuickTextEdit::contentHeight | ( | ) | const |
\qmlproperty real QtQuick::TextEdit::contentHeight
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 1024 of file qquicktextedit.cpp.
References d.
|
signal |
Referenced by QQuickTextAreaPrivate::attachFlickable(), and QQuickTextAreaPrivate::detachFlickable().
qreal QQuickTextEdit::contentWidth | ( | ) | const |
\qmlproperty real QtQuick::TextEdit::contentWidth
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 1012 of file qquicktextedit.cpp.
References d.
QQmlComponent * QQuickTextEdit::cursorDelegate | ( | ) | const |
\qmlproperty Component QtQuick::TextEdit::cursorDelegate The delegate for the cursor in the TextEdit.
If you set a cursorDelegate for a TextEdit, 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 text edit when a cursor is needed, and the x and y properties of 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 1287 of file qquicktextedit.cpp.
References d.
|
signal |
int QQuickTextEdit::cursorPosition | ( | ) | const |
\qmlproperty int QtQuick::TextEdit::cursorPosition The position of the cursor in the TextEdit.
The cursor is positioned between characters.
Definition at line 1255 of file qquicktextedit.cpp.
References d.
|
signal |
QRectF QQuickTextEdit::cursorRectangle | ( | ) | const |
\qmlproperty rectangle QtQuick::TextEdit::cursorRectangle
The rectangle where the standard text cursor is rendered within the text edit. 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 1716 of file qquicktextedit.cpp.
References d.
|
signal |
Referenced by QQuickTextAreaPrivate::attachFlickable(), and QQuickTextAreaPrivate::detachFlickable().
|
signal |
|
slot |
\qmlmethod QtQuick::TextEdit::deselect()
Removes active text selection.
Definition at line 1788 of file qquicktextedit.cpp.
References d.
QQuickTextEdit::HAlignment QQuickTextEdit::effectiveHAlign | ( | ) | const |
Definition at line 732 of file qquicktextedit.cpp.
References AlignLeft, AlignRight, and d.
Referenced by QQuickTextArea::updatePaintNode().
|
signal |
|
overrideprotectedvirtual |
\reimp
Reimplemented from QQuickItem.
Definition at line 1722 of file qquicktextedit.cpp.
References d, QObject::event(), and QEvent::ShortcutOverride.
|
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 2874 of file qquicktextedit.cpp.
References d, and QQuickItem::focusInEvent().
Referenced by QQuickTextArea::focusInEvent().
bool QQuickTextEdit::focusOnPress | ( | ) | const |
\qmlproperty bool QtQuick::TextEdit::activeFocusOnPress
Whether the TextEdit should gain active focus on a mouse press. By default this is set to true.
Definition at line 1370 of file qquicktextedit.cpp.
References d.
|
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 2881 of file qquicktextedit.cpp.
References d, and QQuickItem::focusOutEvent().
Referenced by QQuickTextArea::focusOutEvent().
QFont QQuickTextEdit::font | ( | ) | const |
Definition at line 561 of file qquicktextedit.cpp.
References d.
Referenced by setFont(), and QQuickFontDialogImplAttached::setSampleEdit().
|
overrideprotectedvirtual |
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 1490 of file qquicktextedit.cpp.
References d, QQuickItem::geometryChange(), QRectF::height(), QQuickItem::heightValid(), QRectF::width(), and QQuickItem::widthValid().
Referenced by QQuickTextArea::geometryChange().
QString QQuickTextEdit::getFormattedText | ( | int | start, |
int | end | ||
) | const |
\qmlmethod string QtQuick::TextEdit::getFormattedText(int start, int end)
Returns the section of text that is between the start and end positions.
The returned text will be formatted according the \l textFormat property.
Definition at line 2978 of file qquicktextedit.cpp.
References cursor, d, QTextCursor::KeepAnchor, QTextCursor::MoveAnchor, and qBound().
QString QQuickTextEdit::getText | ( | int | start, |
int | end | ||
) | const |
\qmlmethod string QtQuick::TextEdit::getText(int start, int end)
Returns the section of text that is between the start and end positions.
The returned text does not include any rich text formatting.
Definition at line 2953 of file qquicktextedit.cpp.
References cursor, d, QTextCursor::KeepAnchor, QTextCursor::MoveAnchor, and qBound().
Referenced by isRightToLeft().
QQuickTextEdit::HAlignment QQuickTextEdit::hAlign | ( | ) | const |
\qmlproperty enumeration QtQuick::TextEdit::horizontalAlignment \qmlproperty enumeration QtQuick::TextEdit::verticalAlignment \qmlproperty enumeration QtQuick::TextEdit::effectiveHorizontalAlignment
Sets the horizontal and vertical alignment of the text within the TextEdit 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.
Valid values for horizontalAlignment
are:
\value TextEdit.AlignLeft left alignment with ragged edges on the right (default) \value TextEdit.AlignRight align each line to the right with ragged edges on the left \value TextEdit.AlignHCenter align each line to the center \value TextEdit.AlignJustify align each line to both right and left, spreading out words as necessary
Valid values for verticalAlignment
are:
\value TextEdit.AlignTop start at the top of the item (default) \value TextEdit.AlignBottom align the last line to the bottom and other lines above \value TextEdit.AlignVCenter align the center vertically
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 TextEdit, use the read-only property effectiveHorizontalAlignment
.
Definition at line 705 of file qquicktextedit.cpp.
References d.
|
signal |
QString QQuickTextEdit::hoveredLink | ( | ) | const |
\qmlsignal QtQuick::TextEdit::linkHovered(string link)
This signal is emitted when the user hovers a link embedded in the text. The link must be in rich text or HTML format and the link string provides access to the particular link.
\qmlsignal QtQuick::TextEdit::editingFinished()
This signal is emitted when the text edit loses focus.
\qmlproperty string QtQuick::TextEdit::hoveredLink
This property contains the link string when the user hovers a link embedded in the text. The link must be in rich text or HTML format and the link string provides access to the particular link.
Definition at line 3117 of file qquicktextedit.cpp.
References d, QQuickTextEditPrivate::isLinkHoveredConnected(), pos, QCursor::pos(), and QQuickItemPrivate::window.
|
overrideprotectedvirtual |
This event handler can be reimplemented in a subclass to receive hover-enter events for an item.
The event information is provided by the event parameter.
Hover events are only provided if acceptHoverEvents() is true.
\input item.qdocinc accepting-events
Reimplemented from QQuickItem.
Definition at line 3133 of file qquicktextedit.cpp.
References d.
|
overrideprotectedvirtual |
This event handler can be reimplemented in a subclass to receive hover-leave events for an item.
The event information is provided by the event parameter.
Hover events are only provided if acceptHoverEvents() is true.
\input item.qdocinc accepting-events
Reimplemented from QQuickItem.
Definition at line 3149 of file qquicktextedit.cpp.
References d.
|
overrideprotectedvirtual |
This event handler can be reimplemented in a subclass to receive hover-move events for an item.
The event information is provided by the event parameter.
Hover events are only provided if acceptHoverEvents() is true.
\input item.qdocinc accepting-events
Reimplemented from QQuickItem.
Definition at line 3141 of file qquicktextedit.cpp.
References d.
|
signal |
Qt::InputMethodHints QQuickTextEdit::inputMethodHints | ( | ) | const |
\qmlproperty enumeration QtQuick::TextEdit::inputMethodHints
Provides hints to the input method about the expected content of the text edit 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 1464 of file qquicktextedit.cpp.
References d, and Qt::ImhNone.
|
signal |
\qmlmethod QtQuick::TextEdit::insert(int position, string text)
Inserts text into the TextEdit at position.
Definition at line 3011 of file qquicktextedit.cpp.
References cursor, d, Qt::mightBeRichText(), position(), and QQuickTextEditPrivate::text.
|
overridevirtual |
Implements QQuickTextInterface.
Definition at line 405 of file qquicktextedit.cpp.
References QMetaObject::invokeMethod().
bool QQuickTextEdit::isCursorVisible | ( | ) | const |
\qmlproperty bool QtQuick::TextEdit::cursorVisible If true the text edit shows a cursor.
This property is set and unset when the text edit gets active focus, but it can also be set directly (useful, for example, if a KeyProxy might forward keys to it).
Definition at line 1223 of file qquicktextedit.cpp.
References d.
Referenced by componentComplete().
bool QQuickTextEdit::isInputMethodComposing | ( | ) | const |
\qmlproperty bool QtQuick::TextEdit::inputMethodComposing
This property holds whether the TextEdit has partial text input from an input method.
While it is composing an input method may rely on mouse or key events from the TextEdit 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 2418 of file qquicktextedit.cpp.
References d.
bool QQuickTextEdit::isReadOnly | ( | ) | const |
Definition at line 1700 of file qquicktextedit.cpp.
References d, and Qt::TextEditable.
Referenced by mousePressEvent(), selectByKeyboard(), setReadOnly(), and updatePaintNode().
|
slot |
\qmlmethod QtQuick::TextEdit::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 1858 of file qquicktextedit.cpp.
References getText(), QString::isRightToLeft(), and qmlWarning().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given key event.
Reimplemented from QQuickItem.
Definition at line 1763 of file qquicktextedit.cpp.
References d, and QQuickItem::keyPressEvent().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given key event.
Reimplemented from QQuickItem.
Definition at line 1775 of file qquicktextedit.cpp.
References d, and QQuickItem::keyReleaseEvent().
qreal QQuickTextEdit::leftPadding | ( | ) | const |
Definition at line 3276 of file qquicktextedit.cpp.
References d.
int QQuickTextEdit::length | ( | ) | const |
\qmlproperty int QtQuick::TextEdit::length
Returns the total number of plain text characters in the TextEdit item.
As this number doesn't include any formatting markup it may not be the same as 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 TextEdit's internal string data.
Definition at line 999 of file qquicktextedit.cpp.
int QQuickTextEdit::lineCount | ( | ) | const |
\qmlproperty int QtQuick::TextEdit::lineCount
Returns the total number of lines in the TextEdit item.
Definition at line 981 of file qquicktextedit.cpp.
References d.
|
signal |
|
overrideprotectedvirtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event.
Reimplemented from QQuickItem.
Definition at line 1972 of file qquicktextedit.cpp.
References d, and QQuickItem::mouseDoubleClickEvent().
Referenced by QQuickTextArea::mouseDoubleClickEvent().
|
overrideprotectedvirtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event.
Reimplemented from QQuickItem.
Definition at line 1984 of file qquicktextedit.cpp.
References d, and QQuickItem::mouseMoveEvent().
Referenced by QQuickTextArea::mouseMoveEvent().
|
overrideprotectedvirtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event.
Reimplemented from QQuickItem.
Definition at line 1934 of file qquicktextedit.cpp.
References d, QQuickItem::forceActiveFocus(), QQuickItem::hasActiveFocus(), QQuickDeliveryAgentPrivate::isEventFromMouseOrTouchpad(), isReadOnly(), Qt::MouseFocusReason, QQuickItem::mousePressEvent(), Q_UNUSED, qGuiApp, and QQuickItem::setKeepMouseGrab().
Referenced by QQuickTextArea::mouseDoubleClickEvent(), QQuickTextArea::mouseMoveEvent(), QQuickTextArea::mousePressEvent(), and QQuickTextArea::mouseReleaseEvent().
|
overrideprotectedvirtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Handles the given mouse event.
Reimplemented from QQuickItem.
Definition at line 1959 of file qquicktextedit.cpp.
References d, and QQuickItem::mouseReleaseEvent().
Referenced by QQuickTextArea::mouseReleaseEvent().
QQuickTextEdit::SelectionMode QQuickTextEdit::mouseSelectionMode | ( | ) | const |
\qmlproperty enumeration QtQuick::TextEdit::mouseSelectionMode
Specifies how text should be selected using a mouse.
\value TextEdit.SelectCharacters (default) The selection is updated with individual characters. \value TextEdit.SelectWords The selection is updated with whole words.
This property only applies when \l selectByMouse is true.
Definition at line 1638 of file qquicktextedit.cpp.
References d.
|
signal |
void QQuickTextEdit::moveCursorSelection | ( | int | pos | ) |
\qmlmethod QtQuick::TextEdit::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 {TextEdit.SelectCharacters}
.
\value TextEdit.SelectCharacters Sets either the selectionStart or selectionEnd (whichever was at the previous cursor position) to the specified position. \value TextEdit.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:
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 TextEdit.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 1156 of file qquicktextedit.cpp.
References cursor, d, QTextCursor::KeepAnchor, and pos.
void QQuickTextEdit::moveCursorSelection | ( | int | pos, |
SelectionMode | mode | ||
) |
Definition at line 1167 of file qquicktextedit.cpp.
References cursor, d, QTextCursor::EndOfWord, QTextCursor::KeepAnchor, QTextCursor::MoveAnchor, pos, QTextCursor::PreviousCharacter, QTextCursor::PreviousWord, SelectCharacters, and QTextCursor::StartOfWord.
bool QQuickTextEdit::overwriteMode | ( | ) | const |
\qmlproperty bool QtQuick::TextEdit::overwriteMode
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 1747 of file qquicktextedit.cpp.
References d.
|
signal |
qreal QQuickTextEdit::padding | ( | ) | const |
These properties hold the padding around the content. This space is reserved in addition to the contentWidth and contentHeight.
Definition at line 3222 of file qquicktextedit.cpp.
References d.
bool QQuickTextEdit::persistentSelection | ( | ) | const |
\qmlproperty bool QtQuick::TextEdit::persistentSelection
Whether the TextEdit should keep the selection visible when it loses active focus to another item in the scene. By default this is set to false.
Definition at line 1391 of file qquicktextedit.cpp.
References d.
|
signal |
\qmlmethod int QtQuick::TextEdit::positionAt(int x, int y)
Returns the text position closest to pixel position (x, y).
Position 0 is before the first character, position 1 is after the first character but before the second, and so on until position \l {text}.length, which is after all characters.
Definition at line 1092 of file qquicktextedit.cpp.
References cursor, d, Qt::FuzzyHit, and layout.
QRectF QQuickTextEdit::positionToRectangle | ( | int | pos | ) | const |
\qmlmethod rectangle QtQuick::TextEdit::positionToRectangle(position)
Returns the rectangle at the given position in the text. The x, y, and height properties correspond to the cursor that would describe that position.
Definition at line 1075 of file qquicktextedit.cpp.
|
signal |
|
signal |
|
slot |
|
signal |
QQuickTextEdit::Q_REVISION | ( | 2 | , |
3 | |||
) |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
QQuickTextEdit::Q_REVISION | ( | 2 | , |
7 | |||
) | const |
|
slot |
|
signal |
|
signal |
Referenced by QQuickTextArea::QQuickTextArea(), and setReadOnly().
|
slot |
\qmlmethod QtQuick::TextEdit::redo()
Redoes the last operation if redo is \l {canRedo}{available}.
Definition at line 1924 of file qquicktextedit.cpp.
References d.
|
slot |
\qmlmethod string QtQuick::TextEdit::remove(int start, int end)
Removes the section of text that is between the start and end positions from the TextEdit.
Definition at line 3043 of file qquicktextedit.cpp.
References cursor, d, QTextCursor::KeepAnchor, QTextCursor::MoveAnchor, and qBound().
QQuickTextEdit::RenderType QQuickTextEdit::renderType | ( | ) | const |
\qmlproperty enumeration QtQuick::TextEdit::renderType
Override the default rendering type for this component.
Supported render types are:
\value TextEdit.QtRendering Text is rendered using a scalable distance field for each glyph. \value TextEdit.NativeRendering Text is rendered using a platform-specific technique.
Select TextEdit.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.
The default rendering type is determined by \l QQuickWindow::textRenderType().
Definition at line 541 of file qquicktextedit.cpp.
References d.
|
signal |
void QQuickTextEdit::resetBaseUrl | ( | ) |
Definition at line 1060 of file qquicktextedit.cpp.
References context, qmlContext(), and setBaseUrl().
void QQuickTextEdit::resetBottomPadding | ( | ) |
Definition at line 3330 of file qquicktextedit.cpp.
References d.
void QQuickTextEdit::resetHAlign | ( | ) |
Definition at line 722 of file qquicktextedit.cpp.
References d, and QQuickItem::isComponentComplete().
void QQuickTextEdit::resetLeftPadding | ( | ) |
Definition at line 3290 of file qquicktextedit.cpp.
References d.
void QQuickTextEdit::resetPadding | ( | ) |
Definition at line 3251 of file qquicktextedit.cpp.
void QQuickTextEdit::resetRightPadding | ( | ) |
Definition at line 3310 of file qquicktextedit.cpp.
References d.
void QQuickTextEdit::resetTopPadding | ( | ) |
Definition at line 3270 of file qquicktextedit.cpp.
References d.
qreal QQuickTextEdit::rightPadding | ( | ) | const |
Definition at line 3296 of file qquicktextedit.cpp.
References d.
|
slot |
\qmlmethod QtQuick::TextEdit::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).
Definition at line 1833 of file qquicktextedit.cpp.
References cursor, d, QTextCursor::KeepAnchor, and QTextCursor::MoveAnchor.
|
slot |
\qmlmethod QtQuick::TextEdit::selectAll()
Causes all text to be selected.
Definition at line 1801 of file qquicktextedit.cpp.
References d.
bool QQuickTextEdit::selectByKeyboard | ( | ) | const |
\qmlproperty bool QtQuick::TextEdit::selectByKeyboard
Defaults to true when the editor is editable, and false when read-only.
If true, the user can use the keyboard to select text even if the editor is read-only. If false, the user cannot use the keyboard to select text even if the editor is editable.
Definition at line 1557 of file qquicktextedit.cpp.
References d, and isReadOnly().
bool QQuickTextEdit::selectByMouse | ( | ) | const |
\qmlproperty bool QtQuick::TextEdit::selectByMouse
Defaults to true
since Qt 6.4.
If true
, the user can use the mouse to select text in the usual way.
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 TextEdit was used inside a Flickable. However, Qt has supported text selection handles on mobile platforms, and on embedded platforms using Qt Virtual Keyboard, since version 5.7, via QInputMethod. Most users would be surprised if finger dragging selected text rather than flicking the parent Flickable. Therefore, selectByMouse now really means what it says: if true
, you can select text by dragging only with a mouse, whereas the platform is expected to provide selection handles on touchscreens. 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 1603 of file qquicktextedit.cpp.
References d.
|
signal |
QString QQuickTextEdit::selectedText | ( | ) | const |
\qmlproperty string QtQuick::TextEdit::selectedText
This read-only property provides the text currently selected in the text edit.
It is equivalent to the following snippet, but is faster and easier to use.
Definition at line 1352 of file qquicktextedit.cpp.
References d.
|
signal |
QColor QQuickTextEdit::selectedTextColor | ( | ) | const |
\qmlproperty color QtQuick::TextEdit::selectedTextColor
The selected text color, used in selections.
Definition at line 656 of file qquicktextedit.cpp.
References d.
QColor QQuickTextEdit::selectionColor | ( | ) | const |
\qmlproperty color QtQuick::TextEdit::selectionColor
The text highlight color, used behind selections.
Definition at line 634 of file qquicktextedit.cpp.
References d.
int QQuickTextEdit::selectionEnd | ( | ) | const |
\qmlproperty int QtQuick::TextEdit::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().
Definition at line 1332 of file qquicktextedit.cpp.
References d.
|
signal |
int QQuickTextEdit::selectionStart | ( | ) | const |
\qmlproperty int QtQuick::TextEdit::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().
Definition at line 1316 of file qquicktextedit.cpp.
References d.
|
signal |
|
slot |
\qmlmethod QtQuick::TextEdit::selectWord()
Causes the word closest to the current cursor position to be selected.
Definition at line 1812 of file qquicktextedit.cpp.
References d, and QTextCursor::WordUnderCursor.
Definition at line 1049 of file qquicktextedit.cpp.
References baseUrl, baseUrlChanged(), d, emit, and url.
Referenced by resetBaseUrl().
Definition at line 3324 of file qquicktextedit.cpp.
References d, and QQuickTextEditPrivate::padding().
Definition at line 618 of file qquicktextedit.cpp.
References color, colorChanged(), d, and emit.
void QQuickTextEdit::setCursorDelegate | ( | QQmlComponent * | c | ) |
Definition at line 1293 of file qquicktextedit.cpp.
References d, and QQuickTextUtil::setCursorDelegate().
void QQuickTextEdit::setCursorPosition | ( | int | pos | ) |
Definition at line 1261 of file qquicktextedit.cpp.
void QQuickTextEdit::setCursorVisible | ( | bool | on | ) |
Definition at line 1229 of file qquicktextedit.cpp.
References QQuickTextUtil::createCursor(), cursorVisibleChanged(), d, emit, and QQuickItem::isComponentComplete().
Referenced by setReadOnly().
void QQuickTextEdit::setFocusOnPress | ( | bool | on | ) |
Definition at line 1376 of file qquicktextedit.cpp.
References activeFocusOnPressChanged(), d, and emit.
Definition at line 567 of file qquicktextedit.cpp.
References d, emit, font, fontChanged(), QFontMetrics::height(), Qt::ImAnchorRectangle, Qt::ImCursorRectangle, Qt::ImFont, and qRound().
void QQuickTextEdit::setHAlign | ( | HAlignment | align | ) |
Definition at line 711 of file qquicktextedit.cpp.
References d, and QQuickItem::isComponentComplete().
void QQuickTextEdit::setInputMethodHints | ( | Qt::InputMethodHints | hints | ) |
Definition at line 1474 of file qquicktextedit.cpp.
References d, emit, Qt::ImHints, inputMethodHintsChanged(), and Q_UNUSED.
Definition at line 3284 of file qquicktextedit.cpp.
References d, and QQuickTextEditPrivate::padding().
void QQuickTextEdit::setMouseSelectionMode | ( | SelectionMode | mode | ) |
Definition at line 1644 of file qquicktextedit.cpp.
References d, emit, mouseSelectionModeChanged(), and SelectWords.
void QQuickTextEdit::setOverwriteMode | ( | bool | overwrite | ) |
Definition at line 1753 of file qquicktextedit.cpp.
References d.
Definition at line 3228 of file qquicktextedit.cpp.
References d, emit, QQuickTextEditPrivate::padding(), qFuzzyCompare(), and QQuickTextEditPrivate::UpdatePaintNode.
void QQuickTextEdit::setPersistentSelection | ( | bool | on | ) |
Definition at line 1397 of file qquicktextedit.cpp.
References d, emit, and persistentSelectionChanged().
void QQuickTextEdit::setReadOnly | ( | bool | r | ) |
\qmlproperty bool QtQuick::TextEdit::readOnly
Whether the user can interact with the TextEdit item. If this property is set to true the text cannot be edited by user interaction.
By default this property is false.
Definition at line 1662 of file qquicktextedit.cpp.
References d, emit, QTextCursor::End, QQuickItem::hasActiveFocus(), Qt::ImEnabled, isReadOnly(), Qt::LinksAccessibleByMouse, readOnlyChanged(), setCursorVisible(), QQuickItem::setFlag(), Qt::TextEditable, Qt::TextSelectableByKeyboard, and Qt::TextSelectableByMouse.
void QQuickTextEdit::setRenderType | ( | QQuickTextEdit::RenderType | renderType | ) |
Definition at line 547 of file qquicktextedit.cpp.
References d, emit, QQuickItem::isComponentComplete(), renderType, and renderTypeChanged().
Definition at line 3304 of file qquicktextedit.cpp.
References d, and QQuickTextEditPrivate::padding().
void QQuickTextEdit::setSelectByKeyboard | ( | bool | on | ) |
Definition at line 1565 of file qquicktextedit.cpp.
References d, emit, selectByKeyboard, and Qt::TextSelectableByKeyboard.
void QQuickTextEdit::setSelectByMouse | ( | bool | on | ) |
Definition at line 1609 of file qquicktextedit.cpp.
References d, emit, selectByMouseChanged(), QQuickItem::setKeepMouseGrab(), and Qt::TextSelectableByMouse.
Definition at line 662 of file qquicktextedit.cpp.
References color, d, emit, and selectedTextColorChanged().
Definition at line 640 of file qquicktextedit.cpp.
References color, d, emit, and selectionColorChanged().
Definition at line 3350 of file qquicktextedit.cpp.
References d, emit, QTextOption::setTabStopDistance(), and QTextOption::tabStopDistance().
\qmlproperty string QtQuick::TextEdit::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::TextEdit::font.styleName
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::TextEdit::font.bold
Sets whether the font weight is bold.
\qmlproperty int QtQuick::TextEdit::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 TextEdit { text: "Hello"; font.weight: Font.DemiBold } \endqml
\qmlproperty bool QtQuick::TextEdit::font.italic
Sets whether the font has an italic style.
\qmlproperty bool QtQuick::TextEdit::font.underline
Sets whether the text is underlined.
\qmlproperty bool QtQuick::TextEdit::font.strikeout
Sets whether the font has a strikeout style.
\qmlproperty real QtQuick::TextEdit::font.pointSize
Sets the font size in points. The point size must be greater than zero.
\qmlproperty int QtQuick::TextEdit::font.pixelSize
Sets the font size in pixels.
Using this function makes the font device dependent. Use \l{TextEdit::font.pointSize} to set the size of the font in a device independent manner.
\qmlproperty real QtQuick::TextEdit::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::TextEdit::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::TextEdit::font.capitalization
Sets the capitalization for the text.
\value Font.MixedCase 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 TextEdit { text: "Hello"; font.capitalization: Font.AllLowercase } \endqml
\qmlproperty enumeration QtQuick::TextEdit::font.hintingPreference
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.
\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 TextEdit { text: "Hello"; renderType: TextEdit.NativeRendering; font.hintingPreference: Font.PreferVerticalHinting } \endqml
\qmlproperty bool QtQuick::TextEdit::font.kerning
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 TextEdit { text: "OATS FLAVOUR WAY"; kerning: font.false } \endqml
\qmlproperty bool QtQuick::TextEdit::font.preferShaping
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 TextEdit { text: "Some text"; font.preferShaping: false } \endqml
\qmlproperty object QtQuick::TextEdit::font.features
qml-font-features
\qmlproperty string QtQuick::TextEdit::text
The text to display. If the text format is AutoText the text edit will automatically determine whether the text should be treated as rich text. This determination is made using Qt::mightBeRichText(). However, detection of Markdown is not automatic.
The text-property is mostly suitable for setting the initial content and handling modifications to relatively small text content. The append(), insert() and remove() methods provide more fine-grained control and remarkably better performance for modifying especially large rich text content.
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.
Definition at line 380 of file qquicktextedit.cpp.
References AutoText, d, QQuickItem::isComponentComplete(), QQuickItem::ItemObservesViewport, QQuickTextEditPrivate::largeTextSizeThreshold, MarkdownText, Qt::mightBeRichText(), RichText, QQuickItem::setFlag(), QString::size(), and text.
void QQuickTextEdit::setTextFormat | ( | TextFormat | format | ) |
Definition at line 487 of file qquicktextedit.cpp.
References AutoText, d, emit, QQuickItem::isComponentComplete(), MarkdownText, Qt::mightBeRichText(), PlainText, RichText, text, and textFormatChanged().
Definition at line 1417 of file qquicktextedit.cpp.
References d, emit, and textMarginChanged().
Definition at line 3264 of file qquicktextedit.cpp.
References d, and QQuickTextEditPrivate::padding().
void QQuickTextEdit::setVAlign | ( | QQuickTextEdit::VAlignment | alignment | ) |
Definition at line 927 of file qquicktextedit.cpp.
References alignment, d, emit, and verticalAlignmentChanged().
Definition at line 965 of file qquicktextedit.cpp.
References d, emit, and wrapModeChanged().
int QQuickTextEdit::tabStopDistance | ( | ) | const |
\qmlproperty real QtQuick::TextEdit::tabStopDistance
The default distance, in device units, between tab stops.
Definition at line 3344 of file qquicktextedit.cpp.
References d.
QString QQuickTextEdit::text | ( | ) | const |
Definition at line 152 of file qquicktextedit.cpp.
References d, and QQuickItem::isComponentComplete().
|
signal |
QQuickTextDocument * QQuickTextEdit::textDocument | ( | ) |
QQuickTextEdit::TextFormat QQuickTextEdit::textFormat | ( | ) | const |
\qmlproperty enumeration QtQuick::TextEdit::textFormat
The way the \l text property should be displayed.
Supported text formats are:
\value TextEdit.PlainText (default) all styling tags are treated as plain text \value TextEdit.AutoText detected via the Qt::mightBeRichText() heuristic \value TextEdit.RichText \l {Supported HTML Subset} {a subset of HTML 4} \value TextEdit.MarkdownText \l {https://commonmark.org/help/}{CommonMark} plus the \l {https://guides.github.com/features/mastering-markdown/}{GitHub} extensions for tables and task lists (since 5.14)
The default is TextEdit.PlainText
. If the text format is set to TextEdit.AutoText
, the text edit will automatically determine whether the text should be treated as rich text. This determination is made using Qt::mightBeRichText(), which can detect the presence of an HTML tag on the first line of text, but cannot distinguish Markdown from plain text.
\table \row
With TextEdit.MarkdownText
, checkboxes that result from using the \l {https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown}{GitHub checkbox extension} are interactively checkable.
Text.MarkdownText
, and with the supported subset of HTML, some decorative elements are not rendered as they would be in a web browser: \list Definition at line 481 of file qquicktextedit.cpp.
References d.
|
signal |
qreal QQuickTextEdit::textMargin | ( | ) | const |
\qmlproperty real QtQuick::TextEdit::textMargin
The margin, in pixels, around the text in the TextEdit.
Definition at line 1411 of file qquicktextedit.cpp.
References d.
qreal QQuickTextEdit::topPadding | ( | ) | const |
Definition at line 3256 of file qquicktextedit.cpp.
References d.
|
slot |
\qmlmethod QtQuick::TextEdit::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 1912 of file qquicktextedit.cpp.
References d.
|
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.
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.
Reimplemented from QQuickItem.
Definition at line 2101 of file qquicktextedit.cpp.
References QQuickTextNodeEngine::addFrameDecorations(), QQuickTextNodeEngine::addToSceneGraph(), QRectF::adjusted(), QList< T >::append(), QList< T >::begin(), QTextFrame::begin(), QTextCursor::block(), QTextBlock::blockNumber(), QRectF::bottom(), QTextLayout::boundingRect(), QTextFrame::childFrames(), clipRect(), QList< T >::constBegin(), QList< T >::constEnd(), cursor, d, QList< T >::end(), engine, QTextFrame::firstCursorPosition(), QTextFrame::firstPosition(), QQuickItem::flags(), frame, QTextFrame::frameFormat(), QTextFrameFormat::InFlow, QString::isEmpty(), QList< T >::isEmpty(), isReadOnly(), QRectF::isValid(), it, QQuickItem::ItemObservesViewport, QTextFrame::lastPosition(), QTextBlock::layout(), QTextBlock::length(), QTextLayout::lineForTextPosition(), QMatrix4x4::map(), QSGTransformNode::matrix(), QTextBlock::next(), nodeBreakingSize, QQuickText::Normal, QSGNode::parent(), pos, QTextFrameFormat::position(), QTextBlock::position(), Q_ASSERT, Q_LIKELY, Q_UNUSED, qCDebug, qCWarning, QList< T >::reserve(), resetEngine(), selectionEnd, selectionStart, QList< T >::size(), QQuickTextEditPrivate::Node::startPos(), QList< T >::takeFirst(), QTextBlock::text(), QQuickTextEditPrivate::Node::textNode(), QRectF::top(), QMatrix4x4::translate(), QQuickTextNodeEngine::Unselected, QQuickTextEditPrivate::UpdateAll, updateNodeTransform(), QQuickTextEditPrivate::UpdateNone, QQuickTextEditPrivate::UpdatePaintNode, viewport(), QPointF::x(), and QPointF::y().
Referenced by QQuickTextArea::updatePaintNode().
|
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.
Reimplemented from QQuickItem.
Definition at line 2359 of file qquicktextedit.cpp.
QQuickTextEdit::VAlignment QQuickTextEdit::vAlign | ( | ) | const |
Definition at line 921 of file qquicktextedit.cpp.
References d.
|
signal |
QQuickTextEdit::WrapMode QQuickTextEdit::wrapMode | ( | ) | const |
\qmlproperty enumeration QtQuick::TextEdit::wrapMode
Set this property to wrap the text to the TextEdit item's width. The text will only wrap if an explicit width has been set.
\value TextEdit.NoWrap (default) no wrapping will be performed. If the text contains insufficient newlines, \l {Item::}{implicitWidth} will exceed a set width. \value TextEdit.WordWrap wrapping is done on word boundaries only. If a word is too long, \l {Item::}{implicitWidth} will exceed a set width. \value TextEdit.WrapAnywhere wrapping is done at any point on a line, even if it occurs in the middle of a word. \value TextEdit.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 TextEdit.NoWrap
. If you set a width, consider using TextEdit.Wrap
.
Definition at line 959 of file qquicktextedit.cpp.
References d.
|
signal |
|
friend |
Definition at line 392 of file qquicktextedit_p.h.
|
friend |
Definition at line 391 of file qquicktextedit_p.h.
Definition at line 249 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 63 of file qquicktextedit_p.h.
Referenced by baseUrl(), componentComplete(), and setBaseUrl().
|
readwrite |
Definition at line 77 of file qquicktextedit_p.h.
Referenced by QQuickTextArea::updatePaintNode().
|
read |
Definition at line 63 of file qquicktextedit_p.h.
Referenced by canPaste().
|
read |
Definition at line 63 of file qquicktextedit_p.h.
|
read |
Definition at line 63 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
Referenced by setColor(), QQuickTextArea::setPlaceholderTextColor(), setSelectedTextColor(), and setSelectionColor().
|
read |
Definition at line 412 of file qquicktextedit_p.h.
|
read |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
read |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
read |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
Referenced by QQuickTextArea::font(), and setFont().
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
read |
Definition at line 63 of file qquicktextedit_p.h.
|
read |
Definition at line 63 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 75 of file qquicktextedit_p.h.
Referenced by QQuickTextArea::updatePaintNode().
|
read |
Definition at line 412 of file qquicktextedit_p.h.
|
read |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 63 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 73 of file qquicktextedit_p.h.
|
read |
Definition at line 412 of file qquicktextedit_p.h.
|
read |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
read |
\qmlproperty string QtQuick::TextEdit::preeditText \readonly
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.
Definition at line 78 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 63 of file qquicktextedit_p.h.
Referenced by setRenderType().
|
readwrite |
Definition at line 76 of file qquicktextedit_p.h.
Referenced by QQuickTextArea::updatePaintNode().
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
Referenced by setSelectByKeyboard().
|
readwrite |
Definition at line 63 of file qquicktextedit_p.h.
|
read |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
read |
Definition at line 412 of file qquicktextedit_p.h.
Referenced by updatePaintNode().
|
read |
Definition at line 412 of file qquicktextedit_p.h.
Referenced by updatePaintNode().
|
readwrite |
Definition at line 79 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
Referenced by QQuickTextArea::setPlaceholderText(), setText(), and setTextFormat().
|
read |
\qmlproperty TextDocument QtQuick::TextEdit::textDocument
Returns the QQuickTextDocument of this TextEdit. It can be used to implement syntax highlighting using \l QSyntaxHighlighter.
Definition at line 63 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 74 of file qquicktextedit_p.h.
Referenced by QQuickTextArea::updatePaintNode().
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.
|
readwrite |
Definition at line 412 of file qquicktextedit_p.h.