Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-243

implicitHeight and implicitWidth of Row and Column are not automatically calculated although they are in the Big Qt.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt for MCUs 2.8, Qt for MCUs 2.6
    • QUL Team
    • None

    Description

      *Regarding this, I've already checked Know Issues or Limitations, Row documentation and Column documentation from Qt for MCUs 2.6, but couldn't find notes about this issue.

      1. https://doc.qt.io/QtForMCUs-2.6/qtul-known-issues.html
      2. https://doc.qt.io/QtForMCUs-2.6/qml-qtquick-row.html
      3. https://doc.qt.io/QtForMCUs-2.6/qml-qtquick-column.html

      In big Qt, implicitHeight and implicitWidth of Row and Column are automatically calculated based on what's in them.

      Here's the code from the simple big Qt 6.6 project I created. The project is attached as ControlsBigQt.zip.

       

      // Main.qml
      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      Window {
          width: 640
          visible: true
          title: qsTr("Hello World")
          height: col.implicitHeight
          Column {
              id: col
              spacing: 15
              Row {
                  id: row1
                  Component.onCompleted: {
                      console.log("row1.implicitHeight: " + row1.implicitHeight)
                  }
                  Button{text: "Button"}
                  CheckBox{text: "CheckBox"}
                  RadioButton{text: "RadioButton"}
              }
              Row {
                  CheckBox{text: "CheckBox"}
                  RadioButton{text: "RadioButton"}
              }
              Row {
                  Dial{}
                  Slider {}
              }
              Row {
                  ProgressBar{}
                  Switch{}
              }
          }
          Component.onCompleted: {
              console.log("col.implicitHeight: " + col.implicitHeight)
          }
      }

      The output of the code above is this:

      13:44:21: Starting C:\Users\81808\Downloads\build-ControlsBigQt-Desktop_Qt_6_6_0_MSVC2019_64bit-Debug\appControlsBigQt.exe...
      QML debugging is enabled. Only use this in a safe environment.
      qml: col.implicitHeight: 213
      qml: row1.implicitHeight: 24 

      Here's how it looks:

       

      Here is the code which does the same thing as the one above, but written in Qt for MCUs. The project is attached as Controls_MCU.zip.

      // Controls.qml
      import QtQuick
      import QtQuick.Controls
      Rectangle {
          color: "lightgray"
          height: col.implicitHeight
          Column {
              id: col
              spacing: 15
              Row {
                  id: row1
                  Component.onCompleted: {
                      console.log("row1.implicitHeight: " + row1.implicitHeight)
                  }
                  Button{text: "Button"}
                  CheckBox{text: "CheckBox"}
                  RadioButton{text: "RadioButton"}
              }
              Row {
                  CheckBox{text: "CheckBox"}
                  RadioButton{text: "RadioButton"}
              }
              Row {
                  Dial{}
                  Slider {}
              }
              Row {
                  ProgressBar{}
                  Switch{}
              }
          }
          Component.onCompleted: {
              console.log("col.implicitHeight: " + col.implicitHeight)
          }
      } 

      Here is the output:

      13:50:07: Starting C:\Users\81808\build-Controls-Qt_for_MCUs_2_6_Desktop_32bpp_MSVC-Debug\Controls.exe...
      col.implicitHeight: 0 
      row1.implicitHeight: 0  

      Here's how it looks:

       

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes