35 Q_INTERFACES(QQmlParserStatus)
38 Q_PROPERTY(QQuickTextDocument *document READ document WRITE setDocument NOTIFY documentChanged FINAL REVISION(6, 11))
39 Q_PROPERTY(
int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged FINAL REVISION(6, 11))
40 Q_PROPERTY(
int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged FINAL REVISION(6, 11))
43 Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL)
44 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL)
45 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
46 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged FINAL)
48 QML_NAMED_ELEMENT(TextSelection)
49 QML_ADDED_IN_VERSION(6, 7)
55 NoMove = QTextCursor::NoMove,
84 Q_ENUM(MoveOperation);
86 explicit QQuickTextSelection(QObject *parent =
nullptr);
88 void classBegin() override {}
89 void componentComplete() override;
91 QQuickTextDocument *document()
const;
92 void setDocument(QQuickTextDocument *doc);
94 int selectionStart()
const;
95 void setSelectionStart(
int start);
97 int selectionEnd()
const;
98 void setSelectionEnd(
int end);
100 QString text()
const;
101 void setText(
const QString &text);
104 void setFont(
const QFont &font);
106 QColor color()
const;
107 void setColor(QColor color);
109 Qt::Alignment alignment()
const;
110 void setAlignment(Qt::Alignment align);
112 Q_REVISION(6, 11) Q_INVOKABLE
bool moveSelectionStart(MoveOperation op,
int n = 1);
113 Q_REVISION(6, 11) Q_INVOKABLE
bool moveSelectionEnd(MoveOperation op,
int n = 1);
115 Q_REVISION(6, 11) Q_INVOKABLE
void duplicate();
117 Q_REVISION(6, 11) Q_INVOKABLE
void linkTo(
const QUrl &destination);
120 Q_REVISION(6, 11)
void documentChanged();
121 Q_REVISION(6, 11)
void selectionStartChanged();
122 Q_REVISION(6, 11)
void selectionEndChanged();
126 void alignmentChanged();
129 QTextCursor cursor()
const;
130 void updateFromCharFormat(
const QTextCharFormat &fmt);
131 void updateFromBlockFormat();
134 QTextCursor m_cursor;
135 QTextCharFormat m_charFormat;
136 QTextBlockFormat m_blockFormat;
137 QQuickTextDocument *m_doc =
nullptr;
138 QQuickTextControl *m_control =
nullptr;