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. QWebEngineView slow while resizing
Qt 6.11 is out! See what's new in the release blog

QWebEngineView slow while resizing

Scheduled Pinned Locked Moved Unsolved QtWebEngine
3 Posts 3 Posters 2.7k Views 1 Watching
  • 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.
  • E Offline
    E Offline
    Ediolot
    wrote on last edited by
    #1

    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: https://streamable.com/58i25

    This is the relevant code:

    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
        , webInterface(new QWebEngineView(this))
    {
        ui->setupUi(this);
        ui->gridLayout->addWidget(webInterface);
        webInterface->setUrl(QUrl(HTML_RESOURCE));
    }
    

    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
    
    TARGET = TEST_APP
    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.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      theFront
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jakobtroidl
        wrote on last edited by
        #3

        Hi ediolot,

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

        Best, Jakob

        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