Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-120544

Main window will be resized after set parent for QWebEngineView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.3
    • GUI: Window management
    • None
    • Windows

    Description

      In my case, I create QWidget containing QWebEngineView. But when I set the main window as the parent of the QWebEngineView with the following code snippet, the main window will be resized.

      TestWidget::TestWidget(QWidget* parent)  // parent is main window
      {
          QHBoxLayout *layout = new QHBoxLayout(parent);
          QWebEngineView *view = new QWebEngineView;
          view->createWinId();
          view->setParent(parent);
          layout->addWidget(view); 
      }
      

      Before calling setParent(), the main window is maximum. After calling, the main window will be resized.

      This problem can be reproduced with the attached sample code. The reproduce steps:
      1. Run the application.

      2. Click "QWebEngineView" in toolbar.

      Result: Before click, the window is maximum. After click, the window is not maximum any more.

      Attachments

        1. flicker.zip
          6 kB
        2. flicker-qtquick.zip
          9 kB
        3. video1620128302.mp4
          696 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              axelspoerl Axel Spoerl
              sam.fang Sam Fang
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes