XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.5
    • qt-project.org systems
    • None
    • All

    Description

      Code snippets for this Jira don't support syntax highlighting for qml code.

      This might be solvable

       

      New lines also seem to get mangled when pasting.

      Raw paste

      import QtQuick 6.5
      import QtQuick.Controls
      import QtQuick.LayoutsColumnLayout {
        id: root
        width: parent.width
        height: parent.height
        Rectangle {
          id: rect1
          color: "green"
          Layout.fillHeight: true
          Layout.fillWidth: true
          Layout.minimumHeight: 20
          MouseArea {
            anchors.fill: parent
            onClicked: rect1.Layout.fillHeight = !rect1.Layout.fillHeight
          }    // Doesn't fire
          Behavior on Layout.preferredHeight {
            ScriptAction {
             script: console.log("preferredHeight changed!" + Layout.preferredHeight)
            }
          }    // Doesn't fire
          Behavior on height {
            ScriptAction {
             script: console.log("height changed!" + height)
            }
          }    // Doesn't fire
          Behavior on implicitHeight {
            ScriptAction {
             script: console.log("implicitHeight changed!" + implicitHeight)
            }
          }    // Fires!
          onHeightChanged: {
            script: console.log("onHeightChanged fired!" + height)
          }
          // Fires!
          Behavior on Layout.fillHeight {
            ScriptAction {
             script: console.log("fillHeight changed!" + Layout.fillHeight)
            }
          }  }  Rectangle {
          id: rect2
          color: "red"
          Layout.fillHeight: true
          Layout.fillWidth: true
          Layout.minimumHeight: 20
        }}
       

       

       

      Actual formatted

      import QtQuick 6.5
      import QtQuick.Controls
      import QtQuick.Layouts
      
      ColumnLayout {
        id: root
        width: parent.width
        height: parent.height
        Rectangle {
          id: rect1
          color: "green"
          Layout.fillHeight: true
          Layout.fillWidth: true
          Layout.minimumHeight: 20
          MouseArea {
            anchors.fill: parent
            onClicked: rect1.Layout.fillHeight = !rect1.Layout.fillHeight
          }
      
          // Doesn't fire
          Behavior on Layout.preferredHeight {
            ScriptAction {
             script: console.log("preferredHeight changed!" + Layout.preferredHeight)
            }
          }
      
          // Doesn't fire
          Behavior on height {
            ScriptAction {
             script: console.log("height changed!" + height)
            }
          }
      
          // Doesn't fire
          Behavior on implicitHeight {
            ScriptAction {
             script: console.log("implicitHeight changed!" + implicitHeight)
            }
          }
          
          // Fires!
          onHeightChanged: {
            script: console.log("onHeightChanged fired!" + height)
          }
          // Fires!
          Behavior on Layout.fillHeight {
            ScriptAction {
             script: console.log("fillHeight changed!" + Layout.fillHeight)
            }
          }  
        }
        
        Rectangle {
          id: rect2
          color: "red"
          Layout.fillHeight: true
          Layout.fillWidth: true
          Layout.minimumHeight: 20
        }
      }
       

       

       

      Attachments

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

        Activity

          People

            ablasche Alex Blasche
            mairtin.s Mairtin Steinkamp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes