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

QWebEngineView / winId() conflict

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes