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

QQuickWidget::winId() breaks rendering

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.3.1, 5.4.0
    • Quick: Widget
    • None

    Description

      If winId() gets called at any point on a qquickwidget instance (or even on any of the ancestors of the qquickwidget), rendering will stop immediately, turning it to a black window.
      stderr starts to repeat over and over:
      QQuickWidget cannot be used as a native child widget. Consider setting Qt::AA_DontCreateNativeWidgetSiblings

      Given that error message, the problem seems that winId() turns it into a native window and calls QWidgetPrivate::createWinId, breaking the conditions QQuickWidget needs in order to be able to render correctly.
      Attached there i a simple patch to the qquickwidget example (5.4 branch) that shows the problem.

      Attachments

        1. break.diff
          0.6 kB
        2. testcase.zip
          2 kB

        Issue Links

          For Gerrit Dashboard: QTBUG-40765
          # Subject Branch Project Status CR V

          Activity

            People

              lagocs Laszlo Agocs
              notmart Marco Martin
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes