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. QtWebEngine flashes when the frameless window is maximized
Forum Updated to NodeBB v4.3 + New Features

QtWebEngine flashes when the frameless window is maximized

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 840 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.
  • myxingkongM Offline
    myxingkongM Offline
    myxingkong
    wrote on last edited by myxingkong
    #1

    I have a frameless QtWebEngine program that flashes when the focus changes after running on a screen without a taskbar and maximizing the window.

    It works fine on a screen with a taskbar.

    Following is my test code:

    #include <QWidget>
    #include <QHBoxLayout>
    #include <QApplication>
    #include <QWebEngineView>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
        QWidget* widget = new QWidget(0);
        widget->setWindowFlags(Qt::FramelessWindowHint);
        QHBoxLayout* lay_parent = new QHBoxLayout;
        QWebEngineView *webView = new QWebEngineView;
        webView->load(QUrl("https://qt.io"));
        widget->show();
        lay_parent->addWidget(webView);
        widget->setLayout(lay_parent);
        widget->showMaximized();
        return app.exec();
    }
    

    I tried setting up OpenGL, and it works.
    But on some machines the program will fails to run.

    QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
    

    or

    QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
    

    Is there a better way to stop it from flickering?

    This is my test environment:

    Operating System: Windows 7, Windows 10

    Qt: 5.9.6, 5.12.1

    I have two screens, there's no taskbar on the home screen, the taskbar is expanding the screen, and when I run the program on the home screen it's going to trigger a flicker

    Hello World!

    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