Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.5
-
None
Description
Code snippets for this Jira don't support syntax highlighting for qml code.
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 } }