Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.15.1
-
None
-
Windows 10
-
-
e99a883bd382ca950192bd66cafb2a1de6394ce7 (qt/qtbase/dev) 9b0ffccabd0bf668b052b0ce74980cc3a0b859e5 (qt/qtbase/6.0) bed37717886721888d87a80911a3403df9ef46c9 (qt/qtbase/6.1) b7c4b74146 (qt/tqtc-qtbase/5.15) b7c4b74146 (qt/tqtc-qtbase/tqtc/vxworks-5.15.10)
Description
Our Qt product has recently tried to upgrade from Qt 5.10 to 5.15.1. We worked through most of our issues with only a few outstanding. One of them is proving very difficult and stubborn!
We have a blinking cursor in a QTextEdit that's leaving an artifact while blinking after an image is inserted into the QTextEdit. You can clearly see this in the animated GIF below.
The artifact is the black line at the top of the blinking cursor that doesn't disappear.
We're using a QTextImageFormat when inserting the image.
QTextImageFormat format;
format.setName(svgFileLocation);QSvgRenderer renderer(svgFileLocation);}}
const auto height = 19;
QImage image(height, height, QImage::Format_ARGB32);
image.fill(Qt::transparent);
QPainter painter(&image);
renderer.render(&painter);{{// This line causes the cursor blinking issues!}}
// Comment out this line and the blinking cursor is fixed (but the format is not correct)
format.setVerticalAlignment(QTextCharFormat::AlignBottom);
The line of code that causing problems is:
format.setVerticalAlignment(QTextCharFormat::AlignBottom);
The above line didn't work in Qt 5.10 ... we needed to use the line below instead (and this doesn't work in Qt 5.15!)
format.setVerticalAlignment(QTextCharFormat::AlignBaseline);
I've attached a Visual Studio solution and qrc file that reproduces the problem. It's a tiny little app with a total of 50 lines of code.
Has something else changes around QTextImageFormat that we're not aware of that's causing this bug?
Attachments
Issue Links
- is duplicated by
-
QTBUG-92468 QTextEdit cursor is drawn incorrectly
- Closed