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

Qt.createQmlObject() inside a Row element not causes recalculation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.3.0
    • None
    • Mac OS 10.9.2, Qt 5.3.0-x64-Android-IOS, QtQuick 2.2

    Description

      I used `Qt.createQmlObject()` as follow:

          import QtQuick 2.2;
          
          Rectangle {
              id: root
              width: 300; height: 300
              
              Row {
                  id: itemContainer
                  Component.onCompleted: {
                      var newObject = Qt.createQmlObject('import QtQuick 2.2; Rectangle {color: "red"; width: 200; height: 200}', pages, "");
                  }
                  
                  Rectangle {
                      width: 100; height: 50
                      color: "Yellow"
                  }
              }
          }
      

      This not works and I changed it as follow:

          import QtQuick 2.2;
          
          Rectangle {
              id: root
              width: 300; height: 300
              
              Row {
                  id: itemContainer
                  
                  Rectangle {
                      width: 100; height: 50
                      color: "Yellow"
                  }
      
                  Component.onCompleted: {
                      var newObject = Qt.createQmlObject('import QtQuick 2.2; Rectangle {color: "red"; width: 200; height: 200}', pages, "");
                  }
              }
          }
      

      and it WORKS, but not as expected! not as `Row` child. As you can see, executing `Qt.createQmlObject()` inside a `Row` element not causes to recalculation of some of essential estimations of `Row` element.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            seyed S.M.Mousavi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes