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

Crash when trying to add inline component to non-inline component

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • 5.3.2
    • None
    • Windows 7

    Description

      I have the following component:

      import QtQuick 2.2
      Rectangle
      {
          id: root;
          default property alias contents: contentFrame.children;
          color: "#05f"; width: 100; height: 100;
      
          Rectangle
          {
              id: contentFrame;
              anchors
              {
                  fill: parent;
                  leftMargin: 10; topMargin: 10; rightMargin: 10; bottomMargin: 10;
              }
              color: "#888";
          }
      }
      

      The above component is saved as Test1.qml in a resource file qml.qrc. Now I create another component Test2.qml that uses Test1:

      import QtQuick 2.2
      
      Test1
      {
          id: root;
      
          Rectangle
          {
              id: contentFrame;
              anchors
              {
                  fill: parent;  // Note that this is NOT root, but Test1's default item!
                  leftMargin: 10; topMargin: 10; rightMargin: 10; bottomMargin: 10;
              }
              color: "#0a0";
          }
      
          /* Component // CRASH if you uncomment this!
          {
              id: separator;
              Rectangle
              {
                  height: 1;
                  color: "#fab";
              }
          } */
      }
      

      If you add the definition of some component inside a component whose default property has been changed, the app would immediately crash! Please either implement this feature or make qml emit an error message instead of crashing!

      Attachments

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

        Activity

          People

            aalpert Alan Alpert
            digorydoo Digory Doo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes