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

QWebEnginePage.setBackground(Qt::black) doesn't work for page loading.

    XMLWordPrintable

Details

    • All
    • 85bfaa527 (dev), 603c96942 (6.7), 798574d83 (6.6), 634192eee (6.5), ae9fbb5bf (tqtc/lts-6.5), dcc464b14 (dev), 361091327 (6.7), d466ac041 (6.5)

    Description

      I am working on a local application that is mostly dark. When we load different pages, there is always a white flash during page loading.

      We tried to use QWebEngineView -> page().setBackground(Qt::black), but the only thing that changes is the initial background and nothing more.

      The related doc  https://doc.qt.io/qt-6/qwebenginepage.html#backgroundColor-prop is not describing the reality:

      >> you can set it to match your web content in a hybrid application to prevent the white flashes that may appear during loading.

      But it cannot.

      Minimal codes sample:

      Two black web pages and a button to load between them. Click and you will see the white flash during loading.

      https://github.com/SourceReviver/qtwebengine_bg_not_work

       

      Attachments

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

        Activity

          People

            anualiyas Anu Aliyas
            shenlebantongying shenleban tongying
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: