Skip to content

Instantly share code, notes, and snippets.

@maurges
Created February 18, 2023 21:00
Show Gist options
  • Save maurges/4cec27d74822ee20de7003ae27fe0fb6 to your computer and use it in GitHub Desktop.
Save maurges/4cec27d74822ee20de7003ae27fe0fb6 to your computer and use it in GitHub Desktop.
reactive.qml
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