Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.7.1
-
d35e367e4 (dev), 5c7569454 (6.8), 8275f5e8a (6.7)
Description
Reproducer that builds with 6.7.1 attached. Basically, a TextEditHandler classes is going to modify QTextDocument owned by QQuickTextDocument in either way:
1. Swap in new QTextDocument (see TextEditHandler.h line 14~16 )
2. Edit existing QTextDocument (see TextEditHandler.h line 18)
The former does not work but the latter does. Build and run reproducer
1. Type something in TextEdit (nothing at all is fine too)
2. You will see console outputs new text
3. Click button "resetTextDocument" which is supposed to show "Hello World" in TextEdit
4. Result is that nothing happens, i.e. no new text. "textChanged" signal is not emitted either. And even worse: TextEdit becomes unusable and stops responding to anything
5. Click button "debugTextDocument" and console outputs
void __cdecl TextEditHandler::debug(class QQuickTextDocument *) "Hello World!"
which implies that Qt does think TextEdit holds "Hello World" now.
But with the latter (comment out TextEditHandler.h line 14~16 and uncomment line 18) everything works just as expected.
IDK why I can only edit existing document but not swapping in new document.
Attachments
Issue Links
- relates to
-
QTBUG-35688 QQuickTextEdit: Make it possible to change the text document
- Closed