Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.9
- import QtQuick.Controls 2.2
- import QtQuick.Layouts 1.3
- ApplicationWindow {
- id: root
- visible: true
- width: 640
- height: 480
- property bool toggle: true
- GridLayout {
- anchors.fill: parent
- columns: 4
- Rectangle {
- color: "orange"
- Layout.fillWidth: true
- Layout.fillHeight: true
- Layout.column: root.toggle ? 0 : 3
- }
- Rectangle {
- color: "green"
- Layout.fillWidth: true
- Layout.fillHeight: true
- Layout.column: root.toggle ? 1 : 2
- }
- }
- Button {
- anchors.centerIn: parent
- text: "Switch sides"
- onClicked: root.toggle = !root.toggle
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement