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

Reconsider image provider setup and ownership

    XMLWordPrintable

    Details

    • Technical Risk:
      Normal

      Description

      Image providers are currently stored in the QML engine, which is most likely the wrong place, considering that images are inherently graphical while the engine can be used in a non-UI context. A better place for the image providers might be QQuickWindow.

      We'd also like to have a replacement for QQmlEngine::addImageProvider, as that leads often to non-optional plugins: If a QML module wants to register an image provider, it has to call addImageProvider, for which it needs an engine pointer. The only way to obtain that pointer is by writing a plugin, with a custom initializeEngine method. As that plugin does more than registering types, it cannot be optional.

      Maybe we need to mirror QML singletons, and provide a way to register a factory function. Then the engine could trigger the creation of the providers on-demand – though that raises the question where to store the factory functions.

      We also need to investigate thread-safety:
      1) Is it currently possible to share the same image provider among multiple engines?
      2) If yes, does that actually work, or do we just get lucky when it comes to race conditions.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              qtqmlteam Qt Qml Team User
              Reporter:
              fabiankosmale Fabian Kosmale
              PM Owner:
              Vladimir Minenko Vladimir Minenko
              RnD Owner:
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes