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

QWebEngineView / winId() conflict

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.6.0
    • WebEngine
    • None
    • Mac OS X El Capitan + Xcode 7.1 + Qt 5.6

      On OSX 10.11 QWebEngineView has serious performance issues when there is another widget in the layout, for which winId() is called. In my case this function is needed in order to render video, but in general simple call of winId is enough to see what I mean. The following sample demonstrates the issue. At first, the mouse cursor doesn't switch to the splitter icon when you are going to resize it. At second, when the web view or the main window gets resized, it turns black for some time.

      #include <QtCore>
      #include <QtWidgets>
      #include <QtWebEngineWidgets>
      
      int main(int argc, char * argv[])
      {
      	QApplication app(argc, argv);
      	
          
      	QMainWindow mainWindow;
      	
      	QSplitter *spl = new QSplitter(Qt::Vertical);
      	QWidget *widg = new QWidget;
      	// The following line causes terrible blinking when QWebEngineView is resized or loads a url.
      	// Also it prevents the cursor icon from changing when the mouse hovers over the separator.
      	widg->winId();
      	
      	//QWidget *webView = new QWidget;
      	QWebEngineView *webView = new QWebEngineView;
      	webView->load(QUrl("https://www.qt.io"));
          
      	spl->addWidget(widg);
      	spl->addWidget(webView);
          
      	mainWindow.setCentralWidget(spl);
      	mainWindow.resize(800, 600);
      	mainWindow.show();
          
        
      	return app.exec();
      }
      

      In a real application with more complex layouts and controls which may change in size (e.g. time or speed labels) it causes terrible blinking.

      I suppose, the bug is related to this one, which happens on windows:
      https://bugreports.qt.io/browse/QTBUG-52447

      In general, winId() causes a lot of problems in Qt5. In Qt4 it worked fine.

        1. testwinid.zip
          25 kB
          Pugach Yaroslav
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt_webengine_team Qt WebEngine Team
            mentalmushroom Pugach Yaroslav
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes