Created
February 18, 2023 21:00
-
-
Save maurges/4cec27d74822ee20de7003ae27fe0fb6 to your computer and use it in GitHub Desktop.
reactive.qml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.12 | |
import QtQuick.Controls 2.12 | |
import QtQuick.Layouts 1.12 | |
import QtQuick.Window 2.12 | |
Window { | |
width: column.width | |
height: column.height * 1.5 | |
Column { | |
id: column | |
ScrollView { | |
height: contentHeight + ScrollBar.horizontal.height | |
width: parent.width | |
clip: true | |
RowLayout { | |
width: Math.max(50 + slider.value + spacing, 500) | |
Rectangle { | |
color: "red" | |
height: 50 | |
Layout.fillWidth: false | |
Layout.preferredWidth: slider.value + 5 | |
} | |
Rectangle { | |
color: "blue" | |
height: 50 | |
Layout.fillWidth: true | |
Layout.minimumWidth: 50 | |
} | |
} | |
} | |
Slider { | |
id: slider | |
from: 0 | |
to: 500 | |
width: 300 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment