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

Main window will be resized after set parent for QWebEngineView

XMLWordPrintable

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

      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.

        1. flicker.zip
          6 kB
          Sam Fang
        2. flicker-qtquick.zip
          9 kB
          Evgeny Averin
        3. video1620128302.mp4
          696 kB
          Sam Fang
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            vestbo Tor Arne Vestbø
            sam.fang Sam Fang
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes