Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.5.1
-
None
Description
Collapse doesn't observed animation time.
// Main.qml import QtQuick import QtQuick.Controls import QtQuick.Layouts ApplicationWindow { id: mainWindow visible: true width: 800 height: 480 ColumnLayout { anchors.fill: parent spacing: 0 CollapsibleBar { id: collapsibleBar Layout.alignment: Qt.AlignVCenter | Qt.AlignTop contents: Rectangle { implicitHeight: 300 // this is causing the problem. width: mainWindow.width color: 'lightgray' Text { anchors.centerIn: parent text: 'this light gray bar should appear below the light blue bar.' } } } Rectangle { y: collapsibleBar.height Layout.preferredHeight: 100 Layout.fillWidth: true color: 'lightgreen' Text { anchors.centerIn: parent text: "this light green bar should appear below everything else." } } } } // CollapsibleBar.qml import QtQuick import QtQuick.Controls import QtQuick.Layouts Rectangle { id: bar color: "lightblue" default property alias contents: contentItem.children property bool collapsed: true height: contentsArea.height width: mainWindow.width Column { id: contentsArea RowLayout { id: barHeader width: mainWindow.width height: 32 RoundButton { implicitWidth: 24 implicitHeight: 24 onClicked: { bar.collapsed = !bar.collapsed; } } Text { // Layout.Alignment: Qt.AlignHCenter // BTW: this line doesn't compile. text: "this light blue bar should appear above everything." } } Column { id: contentItem clip: true height: bar.collapsed ? 0 : implicitHeight Behavior on height { NumberAnimation { duration: 500 } } } }