Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
4.7.3
-
None
-
Win 7
Qt 4.7.3
Qt pre 4.7.4 203b5edc04143edce0335c5e62de409c64df4c07
Description
In a TextEdit with wrapMode set to other than TextEdit.NoWrap the paintedWidth is wrong when whitespace characters are typed in the end of a line and exceed the wrap width.
The problem can be seen in the attached application by typing space characters in the end of the first line until the line becomes wider than TextEdit.width. When a space is typed that exceeds the wrap width the value of paintedWidth changes from including all the characters in the first line to including only the characters before the trailing spaces (if there are only spaces in the first line paintedWidth changes to 0).
The bug is that the trailing spaces are dropped from paintedWidth when wrap width is exceeded. They should be included in paintedWidth.
Another example:
The impact of the problem can be seen e.g. in the attached Flickable example taken as is from the TextEdit's documentation here:
http://doc.trolltech.com/main-snapshot/qml-textedit.html
When similarly typing spaces to the end of the line beoynd the TextEdit's width the content size of the Flickable doesn't include them and the user can't pan/flick to see the whole line including the spaces. However, the user can use the keys to see the end of the line because ensureVisible() will manually adjust the Flickable's content position beoynd its width. This solution works poorly because if the user then touches the Flickable it bounces back to the content bounds which are the paintedWidth (without the spaces). I.e. the example is broken because of this bug.
Attachments
Issue Links
- relates to
-
QTBUG-19745 A wrapping TextEdit's cursor not drawn in the end of a line after whitespace
- Closed