Please nominate your Qt Champions for 2021!

QWebEngineView slow while resizing

  • I have not seen many people having this problem, but I have found this issue which makes my desktop application feel slow.

    After adding a QWebView widget to the main layout of the main window and loading the html code, if I resize the window, the contents of the QWebView seem to be lagging while resizing. See the video:

    This is the relevant code:

    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
        , webInterface(new QWebEngineView(this))

    I have also tried adding:

        webInterface->setAttribute( Qt::WA_OpaquePaintEvent, true );
        webInterface->setAttribute( Qt::WA_PaintOnScreen, true );
        webInterface->setAttribute( Qt::WA_DontCreateNativeAncestors, true );
        webInterface->setAttribute( Qt::WA_NativeWindow, true );
        webInterface->setAttribute( Qt::WA_NoSystemBackground, true );
        webInterface->setAutoFillBackground( false );

    In the .pro file:

    QT       += core gui webenginewidgets
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    TEMPLATE = app
    CONFIG += c++11

    This happens in Debug and Release. The program seems to be also consuming "a lot of" CPU while I'm resizing the window (Around 16%).

    Im using:
    Microsoft Windows 10 Pro N (10.0.17134 Build 17134)
    Intel Core i7-6700
    Nvidia GeForce GTX 650 Ti
    Qt 5.10.1 MSVC2017 64bit
    Qt Creator 4.6.0-rc1 (4.5.83)

    Is there any solution to this problem ? I did also found this issue in github which may suggest there is not.

  • Thanks for solve my problem.
    My app feel a lot quick with use setAttribute( Qt::WA_NativeWindow, true );

  • Hi ediolot,

    have you solved this problem in the meantime? I have the same issue.

    Best, Jakob

Log in to reply