TextSelection QML Type

Represents a contiguous selection of text and its properties. More...

Import Statement: import QtQuick
Since: Qt 6.7

Properties

Detailed Description

TextEdit.cursorSelection represents the range of text that is currently selected (for example by dragging the mouse). It can be used to query and modify the selected text, as well as properties in the character and block formats.

Note: This API is considered tech preview and may change or be removed in future versions of Qt.

See also TextEdit and QTextCursor.

Property Documentation

alignment : enumeration

The alignment of the block containing the selected text.

See also QTextBlockFormat::alignment().


color : color

The foreground color of the selected text.

See also QTextCharFormat::foreground().


font : color

The font of the selected text.

See also QTextCharFormat::font().


text : string

The selected text, without any rich text markup.

Setting this property replaces the selected text with the given string.


© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.