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

Remote (http / https) QML file not displayed on browser until a mouse event occurs.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.4.0 Beta4
    • 5.15.0 Beta2
    • None
    • WebAssembly

    Description

      When remote loading (http / https) the main qml file with QQmlApplicationEngine, browsers displays a white screen until a mouse event occurs.

       

      A mouse hovering event on the canvas is enough for things to start working on desktop browsers (making the bug difficult to observe), but on mobile you need an actual click to trigger displaying (thus making it seems like the page has finished loading a white page).

       

      On Chromium android, nothing happens in all cases, qrc or not, mouse event or not (not sure this is related, will open another bug for this).

       

      What I was expecting: same behavior as loading the main qml file from qrc, ie. animation and diplaying starts immediately.

       

      QML loading code sample: 

       

      QString baseUrl = "http://localhost:8000/"QString qmlSubUrl = "qml/main.qml"; 
      QQmlApplicationEngine * engine = new QQmlApplicationEngine();
      const QUrl url(baseUrl + qmlSubUrl); 
       
      QObject::connect(engine, &QQmlApplicationEngine::objectCreated,
                       &app, [url](QObject *obj, const QUrl &objUrl) {
          
      if (!obj && url == objUrl)
              QCoreApplication::exit(-1);
      }, Qt::QueuedConnection);
      
      engine->load(url);
      
      return app.exec();
       
      

       

      Same behavior if I fetch the QML manually (with QNetworkAccessManager, lambda function on finished() signal) and loadData(...) it with engine.

       

      Main QML file is basic, just some remote image loading (https), text displaying and Animations (bug is also triggered when they are disabled).

       

      Full source code attached.

      Attachments

        1. main.cpp
          1 kB
        2. main.qml
          4 kB
        3. qtbug83267_qmlremoteloadingbug.tar.gz
          538 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lpotter Lorn Potter
            lainwir3d Richard Rondu
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes