Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
5.2.0
-
None
-
045f9ce19 (dev)
Description
The following TextArea-based editor example shows that even basic features such as bold/not-bold seem to depend on the C++-only features of QTextDocument:
https://qt-project.org/doc/qt-5.1/qtquickcontrols/text.html
The QML code reads:
onTriggered: document.bold = !document.bold
When document is a DocumentHandler that manipulates the underlying QTextDocument of the TextArea.
Besides being limiting to pure QML code, this is even more of an issue when we consider that the manipulation of that underlying QTextDocument is itself vaguely defined. The documentation reads:
Warning: The QTextDocument provided is used internally by Qt Quick
elements to provide text manipulation primitives. You are not
allowed to perform any modification of the internal state of the
QTextDocument. If you do, the element in question may stop
functioning or crash.
So not only one has to resort to the C++ API for basic manipulation of the TextArea, but it's unclear which of these operations are in fact safe.
It would be useful to have more of that API clearly and cleanly exposed to QML code.
Attachments
Issue Links
- relates to
-
QTBUG-81022 Text editor example contradicts QQuickTextDocument's documentation
- Closed