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

Reconsider image provider setup and ownership

    XMLWordPrintable

Details

    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

              qtqmlteam Qt Qml Team User
              fabiankosmale Fabian Kosmale
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes