TextSelection QML Type

Represents a contiguous selection of text and its properties. 更多...

import 语句: import QtQuick
Since: Qt 6.7

特性

详细描述

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.

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

另请参阅 TextEdit and QTextCursor .

特性文档编制

alignment : enumeration

The alignment of the block containing the selected text.

另请参阅 QTextBlockFormat::alignment ().

color : color

The foreground color of the selected text.

另请参阅 QTextCharFormat::foreground ().

font : color

The font of the selected text.

另请参阅 QTextCharFormat::font ().

text : string

The selected text, without any rich text markup.

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