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

[REG 5.9.2 -> 5.10.0 Beta 2]imageCacher.downloaded.connect(setSourceToProvider) such QML crashes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P1: Critical
    • None
    • 5.10.0 Beta 1, 5.10.0 Beta 2
    • None
    • Windows 10 x64.
    • Android

    Description

      It crashes the app.

      I have a class which checks if image is on disk or not and dowonloads it if needed.
      Once the image is downloaded and saved on disk it calls function to request image from image provider.
      So WITH Qt 5.10 it comes into function

      function setSourceToProvider() {
                      source = "image://imageProvider/" + model.image.toString() // here
                  }
      

      and crashes. It happens even before going to image provider.

      code snippet:

      Image {
                  id: questImage
                  anchors.fill: parent
                  horizontalAlignment: Image.AlignHCenter
                  fillMode: Image.PreserveAspectCrop
                  //smooth: true
                  asynchronous: true
                  cache: true
                  mipmap: true
                  function setSourceToProvider() {
                      source = "image://imageProvider/" + model.image.toString()
                  }
                  Component.onCompleted: {
                      var imageCacher = uhelper.imageCacher(model.image.toString())
                      if (imageCacher.isCached()) {
                          setSourceToProvider()
                      } else {
                          // TODO set to loading image
                          imageCacher.downloaded.connect(setSourceToProvider)
                      }
                  }
              }
      

      Stack trace

      1  ??                                                                                                                                                              0xe37fa580 
      2  QQmlPropertyData * qQmlPropertyCacheProperty<QV4::String const *>(QJSEngine *, QObject *, QV4::String const *, QQmlContextData *, QQmlPropertyData&)            0xe2d7575e 
      3  QV4::QObjectWrapper::findProperty(QV4::ExecutionEngine *, QObject *, QQmlContextData *, QV4::String *, QV4::QObjectWrapper::RevisionMode, QQmlPropertyData *)   0xe2d334b0 
      4  QV4::QObjectWrapper::getQmlProperty(QV4::ExecutionEngine *, QQmlContextData *, QObject *, QV4::String *, QV4::QObjectWrapper::RevisionMode, bool *)             0xe2d33800 
      5  QV4::QQmlContextWrapper::get(QV4::Managed const *, QV4::String *, bool *)                                                                                       0xe2d06db6 
      6  QV4::ExecutionContext::getProperty(QV4::String *)                                                                                                               0xe2cecca6 
      7  QV4::Runtime::method_getActivationProperty(QV4::ExecutionEngine *, int)                                                                                         0xe2d3e16c 
      8  QV4::Moth::VME::run(QV4::ExecutionEngine *, unsigned const char *)                                                                                              0xe2d39768 
      9  QV4::Moth::VME::exec(QV4::ExecutionEngine *, unsigned const char *)                                                                                             0xe2d3be4c 
      10 QV4::Script::run()                                                                                                                                              0xe2d0dd26 
      11 ??                                                                                                                                                              0xdf703268 
      
      

      all works with qt 5.9.2

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            kofr Konstantinr
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes