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.