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

QtQuickTemplates2Plugin uses registerTypes() and unregisterTypes()

XMLWordPrintable

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

      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.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ulherman Ulf Hermann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes