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

[Reg 6.2 -> 6.5] QtQuick.Templates causes crashes if QtQuick types are not registered

    XMLWordPrintable

Details

    • 18804f23d (dev), 5cd35f8fd (6.8), e7f797bb4 (tqtc/lts-6.5)

    Description

      consider the following QML code:

      import QtQuick.Templates 2.15 as T
      T.Control {}
      

      Since sometime between 6.2 and 6.5 this crashes with the following assert:

      ASSERT: "accessibleAttached" in file /home/qt/qt6dev-src/qtdeclarative/src/quicktemplates/qquickcontrol.cpp, line 2163
      

      The code in question looks like this:

      void QQuickControl::accessibilityActiveChanged(bool active)
      {
          Q_D(QQuickControl);
          if (!active)
              return;
      
          QQuickAccessibleAttached *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(qmlAttachedPropertiesObject<QQuickAccessibleAttached>(this, true));
          Q_ASSERT(accessibleAttached);
          accessibleAttached->setRole(d->effectiveAccessibleRole());
      }
      

      This doesn't work if the QQuickAccessibleAttached type is not QML-registered, that is if you haven't imported QtQuick in some way or other.

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              ulherman Ulf Hermann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes