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

implicitWidth/implicitHeight of a non visible layout are null

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.0
    • 5.3.0
    • Quick: Layouts
    • None
    • a76f0ca34fde78ac64300b8bf9a75b5e1c1b6b51

    Description

      Using 5.3.0 on Linux:

      import QtQuick 2.2
      import QtQuick.Controls 1.1
      import QtQuick.Layouts 1.1
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          RowLayout {
              id: row
              visible: false
              Label { id: label; text: "hello world" }
          }
      
          Button {
              text: qsTr("press")
              anchors.centerIn: parent
              onClicked: print("w " + row.implicitWidth + " h " + row.implicitHeight + " label width " + label.implicitWidth)
          }
      }
      
      

      When the button is pressed, implicitWidth and implicitHeight returned are null. When the layout is visible they are not null. implicitWidth/Height should be the same whether the layout is visible or not.

      Attachments

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

        Activity

          People

            smd Jan Arve
            carochao Caroline Chao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes