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

qml plugins are not re-instantiated if qapplication is recreated

XMLWordPrintable

    • c1eda2ead (6.10), d66cfa93e (dev), b483fc5aa (dev), 1da8f2044 (6.10)

      i'm seeing a crash in this scenario:

      • create qApp, QQuickView
      • destroy them
      • re-create qApp, QQuickView

      it crashes when QQuickNativeStyle::style() will returns a nullptr:

      1   QtMin::QQuickStyleItemSlider::calculateGeometry()                                                                                                                                                qquickstyleitemslider.cpp   32   0x1736f15c4 
      2   QtMin::QQuickStyleItem::updateGeometry()                                                                                                                                                         qquickstyleitem.cpp         275  0x1736e8728 
      3   QtMin::QQuickStyleItem::componentComplete()                                                                                                                                                      qquickstyleitem.cpp         471  0x1736ea314 
      4   QtMin::QQmlObjectCreator::finalize(QtMin::QQmlInstantiationInterrupt&)                                                                                                                           qqmlobjectcreator.cpp       1615 0x171d9c92c 
      5   QtMin::QQmlComponentPrivate::complete(QtMin::QQmlEnginePrivate *, QtMin::QQmlComponentPrivate::ConstructionState *)                                                                              qqmlcomponent.cpp           1224 0x171ef84e0 
      6   QtMin::QQmlComponentPrivate::completeDeferred(QtMin::QQmlEnginePrivate *, std::vector<QtMin::QQmlComponentPrivate::ConstructionState> *)                                                         qqmlcomponent.cpp           1217 0x171ee0224 
      7   QtMin::QtQuickPrivate::completeDeferred(QtMin::QObject *, QtMin::QString const&, QtMin::QQuickUntypedDeferredPointer *, QtMin::QQmlEngine *)                                                     qquickdeferredexecute.cpp   166  0x17393c0a8 
      8   void QtMin::quickCompleteDeferred<QtMin::QQuickItem>(QtMin::QObject *, QtMin::QString const&, QtMin::QQuickDeferredPointer<QtMin::QQuickItem>&)                                                  qquickdeferredexecute_p_p.h 67   0x1737f75d4 
      9   QtMin::QQuickSliderPrivate::executeHandle(bool)                                                                                                                                                  qquickslider.cpp            223  0x1738d9928 
      10  QtMin::QQuickSlider::componentComplete()                                                                                                                                                         qquickslider.cpp            867  0x1738db3fc 
      11  QtMin::QQmlObjectCreator::finalize(QtMin::QQmlInstantiationInterrupt&)                                                                                                                           qqmlobjectcreator.cpp       1615 0x171d9c92c 
      12  QtMin::QQmlComponentPrivate::complete(QtMin::QQmlEnginePrivate *, QtMin::QQmlComponentPrivate::ConstructionState *)                                                                              qqmlcomponent.cpp           1224 0x171ef84e0 
      13  QtMin::QQmlComponentPrivate::completeCreate()                                                                                                                                                    qqmlcomponent.cpp           1342 0x171ef68e0 
      14  QtMin::QQmlComponent::completeCreate()                                                                                                                                                           qqmlcomponent.cpp           1308 0x171efa6e4 
      15  QtMin::QQmlComponentPrivate::createWithProperties(QtMin::QObject *, QtMin::QMap<QtMin::QString, QtMin::QVariant>const&, QtMin::QQmlContext *, QtMin::QQmlComponentPrivate::CreateBehavior, bool) qqmlcomponent.cpp           996  0x171ef8328 
      16  QtMin::QQmlComponent::createWithInitialProperties(QtMin::QMap<QtMin::QString, QtMin::QVariant>const&, QtMin::QQmlContext *)                                                                      qqmlcomponent.cpp           962  0x171eee444 
      17  QtMin::QQuickView::continueExecute()                                                                                                                                                             qquickview.cpp              516  0x1728befc0 
      18  QtMin::QQuickViewPrivate::execute(QtMin::QAnyStringView, QtMin::QAnyStringView)                                                                                                                  qquickview.cpp              92   0x1728bf2f8 
      19  QtMin::QQuickView::loadFromModule(QtMin::QAnyStringView, QtMin::QAnyStringView)                                                                                                                  qquickview.cpp              259  0x1728bf67c 
      

      observations:

      • QtQuickControls2NativeStylePlugin::initializeEngine deletes/nulls the s_style pointer via qAddPostRoutine()
      • QQuickNativeStyle::setStyle is never re-populated again via `QtQuickControls2NativeStylePlugin::initializeEngine`

      so it smells like there is some caching that outlives the lifetime of the QApplication, which prevents initializeEngine from running again ...

        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
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: