Is there anyway to replicate this type of hide/flex effect that you can see in this person's question using QML? I am also using QT Creator to aid with the UI building so in the case of my baseline example that I am working with below, I have a button that when pressed, will reveal a white rectangle that will contain more content inside it in the future. And when this white rectangle appears, the grey rectangle that the white one is inside also lengthens accordingly, basically wrapping it. In the process, the Some text is also pushed down like in the after.png When the button is pressed again, the white rectangle should disappear and the Some text should move back up.
Other than using hide to program part of the functionality, I don't know how to make the objects move around like that. Here's the code that corresponds to the after.png
import QtQuick 2.4
import QtQuick.Controls 2.12
Item {
id: item1
width: 800
height: 600
Page {
anchors.fill: parent
Rectangle {
id: bound
color: "#cad2d7"
anchors.fill: parent
anchors.bottomMargin: 0
Button {
id: button
x: 8
y: 8
text: qsTr("Button")
}
Rectangle {
id: rectangle
x: 0
y: 74
width: 800
height: 200
color: "#ffffff"
}
Text {
id: text1
x: 14
y: 293
text: qsTr("Some text")
font.pixelSize: 60
}
}
}
}
I am also using Python (PySide6) but am not sure if some sort of controller would have to be scripted to control the elements. after.png before.png (Note the white that you see in the before.png is just the white background)