Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Blinking cursor leaving an artifact in QTextEdit
Forum Updated to NodeBB v4.3 + New Features

Blinking cursor leaving an artifact in QTextEdit

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 375 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mise
    wrote on last edited by Mise
    #1

    Our Qt product has recently tried to upgrade from Qt 5.10 to 5.15. 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.
    artifact.gif

    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);
    

    Here's a link to 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.
    https://drive.google.com/file/d/1CGf1vErbcsDHnzyiHIq4-DzytGR7RdT9/view

    Is this a known bug or has something else changes around QTextImageFormat that we're not aware of?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Looks like it could be a regression. To see if it's known, the best thing to do is to check the bug report system.

      You might want to first test with the latest release of Qt 5.15 to see if it has been fixed in between,

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • M Offline
        M Offline
        Mise
        wrote on last edited by
        #3

        Thanks @SGaist
        I created a bug here: https://bugreports.qt.io/browse/QTBUG-86823
        It's been triaged and is a P2

        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved