Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.17, 5.2.0
-
None
-
Windows 7 64-bit with MSVC 2010
Description
If you have a QTextEdit with a sufficiently high enough line count, the QTextEdit widget will truncate the displayed text if you switch the LineWrapMode to "NoWrap" and you are using QTextCharFormat to change the text color and/or background color – both mergeCharFormat and setCharFormat behave the same.
I have replicated this on both Qt 4.8.4 and Qt 5.2.0. The environment was on Windows 7 64 with MSVC 2010, as noted. It's believed to do the same on other platforms, but I haven't tested it on others yet.
Attached is a small test-case that exhibits the behavior. Copy the included testdata.txt file to the same folder you are running the .exe from. As presented it will truncate what is shown. If you either comment out line 48 of MainWindow.cpp with the setLineWrapMode to NoWrap or if you comment out line 69 with the call to mergeCharFormat, it will display the entire content, but without the desired wrap mode or text highlighting (respectively).