High cpu usage when moving a gui containing a QtWebEngine and WA_TranslucentBackground
-
Could someone else confirm this bug happens on your side?
https://bugreports.qt.io/browse/QTBUG-109676In my project containing many widgets, it happens 100% of the time, making my GUI freeze when I move it.
To reproduce the bug:
#include <QtWebEngineWidgets/QWebEngineView> QtWidgetsApplication::QtWidgetsApplication(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); setAttribute(Qt::WA_TranslucentBackground); QGridLayout* layout = new QGridLayout(ui.centralWidget); QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_F2), this); connect(shortcut, &QShortcut::activated, [this] { qDebug() << "shortcut"; QWebEngineView* engine = new QWebEngineView(); QGridLayout* layout = qobject_cast<QGridLayout*>(ui.centralWidget->layout()); layout->addWidget(engine); }); }
Press F2 and move the GUI around, here CPU change from 2% to 10%~
When testing sometimes it happened only after I reload the GUI many times and sometimes it happened consecutively.Notes:
I also tested it outside Visual Studio by running the compiled exe directly.
Tested on 3 different machines, and Windows 10/11.