Details
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
For Gerrit Dashboard: QTBUG-112013 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
497860,3 | Keep page's background color when loading new URLs | dev | qt/qtwebengine | Status: MERGED | +2 | 0 |
539792,2 | Keep page's background color when loading new URLs | 6.7 | qt/qtwebengine | Status: MERGED | +2 | 0 |
542833,2 | Keep page's background color when loading new URLs | 6.6 | qt/qtwebengine | Status: MERGED | +2 | 0 |
553593,2 | Keep page's background color when loading new URLs | 6.5 | qt/qtwebengine | Status: MERGED | +2 | 0 |
554945,3 | Keep page's background color when loading new URLs | tqtc/lts-6.5 | qt/tqtc-qtwebengine | Status: MERGED | +2 | 0 |
562893,5 | Prevent the white flashes during loading | dev | qt/qtwebengine | Status: MERGED | +2 | +1 |
565122,2 | Prevent the white flashes during loading | 6.7 | qt/qtwebengine | Status: MERGED | +2 | 0 |
566163,3 | Prevent the white flashes during loading | 6.5 | qt/qtwebengine | Status: MERGED | +2 | 0 |