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

various problems when trying to use QQuickWidget in QML profiler



    • Epic Name:
      Defects in QQuickWidget


      This is a summary of my experiences with trying to use QQuickWidget instead of
      createWindowContainer() in the QML profiler. The basic API is pretty much the same. You just have to
      apply https://codereview.qt-project.org/#change,78555 to reproduce this. One nice thing is that now
      I don't have to hide the main view anymore to show a progressbar. With the window container the
      layering was undefined, leading to various problems. Now I can safely apply
      https://codereview.qt-project.org/#change,78556 and any progress bars will be shown on top of the
      QML scene. Another effect is that I see much fewer artifacts when resizing the dock area (this is on
      X11, see also https://bugreports.qt-project.org/browse/QTBUG-35805)

      However, there are some pretty major flaws still.

      • If I just try with current qtdeclarative it will crash as soon as I select the profiler because
        apparently it doesn't create a renderer if given a size with height == 0, but later expects it to
        be present. Checking for renderer before using it, as in https://codereview.qt-project.org/78553 ,
        works around that.
      • Generally I see a couple of error messages when creating the widgets:
        QOpenGLFramebufferObject: Framebuffer incomplete attachment.
        QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
        QOpenGLFramebufferObject: Framebuffer incomplete attachment.
        QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
      • There are white dashed lines at the bottom right and lower left. See the screenshots.
      • It produces artifacts when hidden and later shown again. In order to see this, I leave out
        https://codereview.qt-project.org/#change,78556 and only try with
        https://codereview.qt-project.org/#change,78555 . If I profile anything, when collecting the data
        the main timeline view is supposed to be hidden and the progress bar is shown. When the collecting
        is done the progress bar is hidden and the timeline is show again. See the screenshots for the
        artifacts I get in that process. Part of that could be due to misuse, in particular the fact that
        the toolbar moves to the center. However, note that after calling show(), the (unrelated) timebar
        widget is invisible. When switching away from the QQuickWidgets and back, e.g. via the events view
        everything looks normal again.
      • The QQuickWidgets go completely black or white when detaching and reattaching them from/to the
        dock as own window. See white.png for that effect. I get more error messages in that case:
        QOpenGLShaderProgram::bind: program is not valid in the current context.
        QOpenGLShaderProgram::bind: program is not valid in the current context.
        QOpenGLShaderProgram::bind: program is not valid in the current context.
        QOpenGLShaderProgram::bind: program is not valid in the current context.
        QOpenGLShaderProgram::bind: program is not valid in the current context.
        QOpenGLShaderProgram::bind: program is not valid in the current context.

        Quite often it just crashes when trying to detach:

        0	??
        1	??	/usr/lib/x86_64-linux-gnu/dri/r600_dri.so		0x7fffd472148d
        2	??	/usr/lib/x86_64-linux-gnu/dri/r600_dri.so		0x7fffd46f8ac6
        3	??	/usr/lib/x86_64-linux-gnu/dri/r600_dri.so		0x7fffd46e9c24
        4	??	/usr/lib/x86_64-linux-gnu/dri/r600_dri.so		0x7fffd46ea2b4
        5	QSGPlainTexture::bind	qsgtexture.cpp	709	0x7fffe6715d71
        6	QSGOpaqueTextureMaterialShader::updateState	qsgtexturematerial.cpp	102	0x7fffe6713dad
        7	QSGBatchRenderer::Renderer::renderMergedBatch	qsgbatchrenderer.cpp	2054	0x7fffe66f2cd8
        8	QSGBatchRenderer::Renderer::renderBatches	qsgbatchrenderer.cpp	2260	0x7fffe66f4280
        9	QSGBatchRenderer::Renderer::render	qsgbatchrenderer.cpp	2414	0x7fffe66f55c8
        10	QSGRenderer::renderScene	qsgrenderer.cpp	259	0x7fffe6707bbe
        11	QSGRenderContext::renderNextFrame	qsgcontext.cpp	363	0x7fffe6720d41
        12	QQuickWindowPrivate::renderSceneGraph	qquickwindow.cpp	385	0x7fffe6778858
        13	QQuickRenderControl::render	qquickrendercontrol.cpp	171	0x7fffe6788b4a
        14	QQuickWidgetPrivate::renderSceneGraph	qquickwidget.cpp	161	0x7fffd7affff9
        15	QQuickWidget::event	qquickwidget.cpp	760	0x7fffd7b021ae
        16	QApplicationPrivate::notify_helper	qapplication.cpp	3519	0x7ffff6d6a392
        17	QApplication::notify	qapplication.cpp	3484	0x7ffff6d6a1f3
        18	QCoreApplication::notifyInternal	qcoreapplication.cpp	937	0x7ffff56d85ba
        19	QCoreApplication::sendEvent	qcoreapplication.h	237	0x7ffff56dc39b
        20	QTimerInfoList::activateTimers	qtimerinfo_unix.cpp	643	0x7ffff57502ac
        0	??			0x140600000001
        1	??	/usr/lib/x86_64-linux-gnu/dri/r600_dri.so		0x7fffd46eddfd
        2	??	/usr/lib/x86_64-linux-gnu/dri/r600_dri.so		0x7fffd46a452e
        3	??	/usr/lib/x86_64-linux-gnu/dri/r600_dri.so		0x7fffd4679c10
        4	??	/usr/lib/x86_64-linux-gnu/dri/r600_dri.so		0x7fffd4679c8e
        5	??	/usr/lib/x86_64-linux-gnu/dri/r600_dri.so		0x7fffd4679d41
        6	??	/usr/lib/x86_64-linux-gnu/dri/r600_dri.so		0x7fffd46750e5
        7	QOpenGLFunctions::glDeleteFramebuffers	qopenglfunctions.h	661	0x7ffff5ffeae2
        8	(anonymous namespace)::freeFramebufferFunc	qopenglframebufferobject.cpp	400	0x7ffff5ffc034
        9	QOpenGLSharedResourceGuard::freeResource	qopenglcontext.cpp	1200	0x7ffff5d35218
        10	QOpenGLContextGroupPrivate::deletePendingResources	qopenglcontext.cpp	1125	0x7ffff5d34f59
        11	QOpenGLContext::makeCurrent	qopenglcontext.cpp	782	0x7ffff5d342ad
        12	QPlatformBackingStore::composeAndFlush	qplatformbackingstore.cpp	206	0x7ffff5f9e470
        13	QXcbBackingStore::composeAndFlush	qxcbbackingstore.cpp	331	0x7fffef6ea4ca
        14	qt_flush	qwidgetbackingstore.cpp	120	0x7ffff6d74a8c
        15	QWidgetBackingStore::flush	qwidgetbackingstore.cpp	1193	0x7ffff6d79ddf
        16	QWidgetBackingStore::endPaint	qwidgetbackingstore.cpp	337	0x7ffff6d753a1
        17	QWidgetBackingStore::doSync	qwidgetbackingstore.cpp	1181	0x7ffff6d79ccc
        18	QWidgetBackingStore::sync	qwidgetbackingstore.cpp	1019	0x7ffff6d78e4b
        19	QWidgetPrivate::syncBackingStore	qwidget.cpp	1690	0x7ffff6da5523
        20	QWidget::event	qwidget.cpp	8261	0x7ffff6db6bb0
      • Doubleclick doesn't work. Select a range in the main view with the range tool from the tool bar.
        Doubleclicking on the selected range normally makes the view zoom into the selection. It doesn't
        with QQuickWidget.
      • Clicks on other widgets are sometimes lost. I don't know how to reproduce that, yet. However, on
        one occasion the application became completely unresponsive because no mouse events were delivered
        to anything anymore and on another occasion I could only access the main menu and had to click
        twice everytime before the click was registered.


        1. artifacts1.png
          28 kB
        2. artifacts2.png
          26 kB
        3. dashedlines1.png
          3 kB
        4. dashedlines2.png
          2 kB
        5. dashedlines3.png
          34 kB
        6. white.png
          6 kB

          Issue Links

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



              ulherman Ulf Hermann
              ulherman Ulf Hermann
              0 Vote for this issue
              5 Start watching this issue



                  Gerrit Reviews

                  There are no open Gerrit changes