Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
4.7.3
-
None
-
Win 7
Qt 4.7.3
Qt pre 4.7.4 203b5edc04143edce0335c5e62de409c64df4c07
Description
A wrapping TextEdit can incorrectly omit painting the cursor when it's in the end of a line outside the TextEdit and preceded by whitespace.
In the attached picture Test.png it can be seen that a user has typed 'Test' and a space into a TextEdit. The cursor can be seen blinking on the right side of the TextEdit.
The problem is that sometimes in the same situation the cursor isn't drawn. In the attached picture TesX.png the user has similarly typed a word and a space. The cursor is on the right side of the TextEdit but isn't drawn.
Also simply typing multiple spaces in the end of a line will always eventually move the cursor out of the TextEdit into a position where the cursor won't be drawn anymore.
TextEdit should draw its cursor in all these situations. The application should be able to decide where to clip the text and the cursor.
Additional details:
- If a cursorDelegate is defined that is drawn correctly
- It seems drawing the cursor is omitted here:
void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context, QTextFrame *frame) const { ... if (context.clip.isValid() && (off.y() > context.clip.bottom() || off.y() + fd->size.height.toReal() < context.clip.top() || off.x() > context.clip.right() || off.x() + fd->size.width.toReal() < context.clip.left())) return; ...
Attachments
Issue Links
- relates to
-
QTBUG-19628 QTextEdit doesn't wrap space at the end of the line
- Closed
-
QTBUG-19667 TextEdit paintedWidth is wrong when whitespace exceeds wrap width
- Closed