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

QtQuickTemplates2Plugin uses registerTypes() and unregisterTypes()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.0 Beta1
    • Quick: Controls 2
    • None

    Description

      We want to deprecate QQmlExtensionPlugin so that people don't use registerTypes() for registering types anymore.

      The templates plugin uses registerTypes() not for registering types but rather for setting a shortcut context matcher. This is wrong for several reasons:

      1. registerTypes() is originally for registering types, and should not be used for other things.
      2. The context matcher should not be a global QtQuick affair, but rather specific per window. Only windows that actually contain QtQuick Controls need the Templates shortcut matcher, and only windows with any QtQuick UI at all should have the Quick one.
      3. Global statics are bad all by themselves.

      This is related to QTBUG-90627 because the image providers should also be per window. Currently they are attached to the QML engine. This forces us to keep the initializeEngine() method around, which is similarly bad.

      Attachments

        Issue Links

          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
              ulherman Ulf Hermann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes