Answer the question
In order to leave comments, you need to log in
How in GridLayout (PyQt5) to make it possible to resize cells with the mouse?
GridLayout {
id: gridLayout
columns: 4
Label {
}
TextField {
Layout.columnSpan: 3
}
}
Answer the question
In order to leave comments, you need to log in
It seems to me that this can not be done using GridLayout'a (or it will be quite difficult). Perhaps TableView or SplitView would be better suited for this.
A quick, hacky solution with SplitView:
import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
SplitView {
anchors.fill: parent
orientation: Qt.Vertical
SplitView {
anchors.left: parent.left
anchors.right: parent.right
height: parent.height / 2
orientation: Qt.Horizontal
Rectangle {
id: rect1
width: parent.width / 2
onWidthChanged: {rect3.width = width}
color: "lightblue"
}
Rectangle {
id: rect2
width: parent.width / 2
onWidthChanged: {rect4.width = width}
color: "lightgreen"
}
}
SplitView {
anchors.left: parent.left
anchors.right: parent.right
height: parent.height / 2
orientation: Qt.Horizontal
Rectangle {
id: rect3
width: parent.width / 2
onWidthChanged: {rect1.width = width}
color: "blue"
}
Rectangle {
id: rect4
width: parent.width / 2
onWidthChanged: {rect2.width = width}
color: "green"
}
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question