Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. High cpu usage when moving a gui containing a QtWebEngine and WA_TranslucentBackground
Forum Updated to NodeBB v4.3 + New Features

High cpu usage when moving a gui containing a QtWebEngine and WA_TranslucentBackground

Scheduled Pinned Locked Moved Unsolved QtWebEngine
2 Posts 1 Posters 408 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CesarC Offline
    CesarC Offline
    Cesar
    wrote on last edited by
    #1

    Could someone else confirm this bug happens on your side?
    https://bugreports.qt.io/browse/QTBUG-109676

    In 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.

    1 Reply Last reply
    0
    • CesarC Offline
      CesarC Offline
      Cesar
      wrote on last edited by
      #2

      Someone else?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved