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

Different result for implicitWidth and implicitHeight use

    XMLWordPrintable

Details

    • b427b69a8efc0502cb06c388c70c8877a13db2f4

    Description

      The following issue was observed with qt-qml:qtquick11 at f15778e6
      and 8c3086aa cherry-picked from 4.7 branch.

      Run the this code and note that the width and height come out differently.
      Also note that the loader's implicit size seems to be ignored, yet the
      print-out in the console suggest they change repeatedly, increasing in
      steps of 20px.

      Perhaps some of this is due to QTBUG-16319?

      import QtQuick 1.1
      Item {
          width: 950
          height: 500
      
          Rectangle {
              color: "green"
              width: loader.implicitWidth+50
              height: loader.implicitHeight+50
              onWidthChanged: print("loader.implicitWidth: " + loader.implicitWidth)
              onHeightChanged: print("loader.implicitHeight: " + loader.implicitHeight)
      
              Item {
                  anchors.fill: parent
                  anchors.margins: 15
      
                  Loader {
                      id: loader
                      sourceComponent: redRect
                      anchors.fill: parent
                      Rectangle { color: "yellow"; opacity: 0.5; anchors.fill: parent; z: 100 }
                  }
              }
          }
      
      
          Component {
              id: redRect
              Item {
                  anchors.centerIn: parent
      
                  implicitWidth: 200
                  implicitHeight: 200
                  Rectangle {
                      color: "red"
                      anchors.fill: parent
                  }
              }
          }
      }
      

      Attachments

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            mathiasm Mathias Malmqvist
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: