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

QQuickWidget Segmentation Fault in setSource

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.8
    • None
    • All

    Description

      If the root object of a Qml document is unknown to QQuickWidget (e.g. if it's not a QQuickItem or a QWindow), then setSource fails with segmentation fault. An example is the existing QML file in the QtDeclarative source code:

      qtdeclarative/src/quickdialogs/quickdialogsquickimpl/qml/+Fusion/ColorDialog.qml

      The root object in this file is ColorDialogImpl, as a result, when I try to load the file in a QQuickWidget (QQuickWidget::setSource), I get segmentation fault.

      The segfault happens with the following message:

      QQuickWidget only supports loading of root objects that derive from QQuickItem. 
      Ensure your QML code is written for QtQuick 2, and uses a root that is or 
      inherits from QtQuick's Item (not a Timer, QtObject, etc). 
      

      Stack trace:
      https://dpaste.org/XEJvB
      The code and more info can be found under the patch:
      https://codereview.qt-project.org/c/qt/qttools/+/624096/comments/9f458086_57a4276d

      Attachments

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

        Activity

          People

            masoud.jami Masoud Jami
            masoud.jami Masoud Jami
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change