Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-93281

Images in TextEdit from a QQuickAsyncImageProvider sometimes don't show

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/X11

    Description

      If you have a text element with inline images, that should get loaded from your image provider, for example:

      TextEdit {
      text: "<img src="image://myImageProvide/something">"
      }
      

      That image only gets shown in some cases. In others you need to otherwise force the TextEdit to be rendered a second time, for example by switching views or emitting a data changed event.

      I'm guessing that for some reason the image is only rendered, if the response is returned fast enough, for example, if the image is already cached. The same image provider works fine if the image is shown in an Image component or similar.

      Since it is pretty hard to know, when an image got cached properly and then emitting the appropriate dataChanged signals, it would be great, if a TextDocument or the Qml users of TextDocuments could automatically rerender, once the image is loaded or otherwise render properly with asynchronous image providers.

      Edit: Complete example attached.

      You can see that after 5 seconds the image is loaded. This however is not reflected in the UI, you need to explicitly resize the window for the image to render. This only seems to happen in TextEdits, which we have to use, since Label/Text does not support text selection.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            deepbluev7 Nicolas Werner
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes