ScrollView Problem
Unsolved
QML and Qt Quick
-
Good evening everyone
I'm working on a small project
And I'm stuck on a small scrollview issueMy problem is that the items don't take up all the available space
Here is the program with Scrollview
And here's another one we delete scrollview
We remove the scrolview element The elements occupy all the available space
I can't understand
ScrollView{ id: flickabe //flickableDirection: Flickable.VerticalFlick anchors.fill: parent clip: true ColumnLayout{ id: layoutMain spacing: 10 anchors.fill: parent Frame{ id: frame width: parent.width height: parent.height GridLayout{ id: grid columns: 2 columnSpacing: 10 anchors.fill: parent Label{ text: qsTr("Nom :") Layout.fillWidth: true Layout.fillHeight: true } TextField{ id: fieldNom Layout.fillWidth: true Layout.fillHeight: true text: qsTr("") validator: RegularExpressionValidator { regularExpression: /[a-z A-Z]+/} onTextEdited: { fieldNom.color = "black" } } Label{ text: qsTr("Nom:") Layout.fillWidth: true Layout.fillHeight: true } TextField{ id: fieldPrenom Layout.fillWidth: true Layout.fillHeight: true text: qsTr("") validator: RegularExpressionValidator { regularExpression: /[a-z A-Z]+/} onTextEdited: { fieldPrenom.color = "black" } } Label{ text: qsTr("Nom:") Layout.fillWidth: true Layout.fillHeight: true } TextField{ id: fieldAge Layout.fillWidth: true Layout.fillHeight: true text: qsTr("") validator: RegularExpressionValidator { regularExpression: /[0-9]+/} onTextEdited: { fieldAge.color = "black" } } Label{ text: qsTr("Nom:") Layout.fillWidth: true Layout.fillHeight: true } ComboBox{ id: comboSexe model: ["Homme", "Femme"] Layout.fillWidth: true Layout.fillHeight: true } Label{ text: qsTr("Nom :") Layout.fillWidth: true Layout.fillHeight: true } TextField{ Layout.fillWidth: true Layout.fillHeight: true text: qsTr("") validator: RegularExpressionValidator { regularExpression: /[a-z A-Z]+/} onTextEdited: { fielGrade.color = "black" } } Label{ text: qsTr("Nom :") Layout.fillWidth: true Layout.fillHeight: true } TextField{ Layout.fillWidth: true Layout.fillHeight: true text: qsTr("") validator: RegularExpressionValidator { regularExpression: /[0-9a-zA-Z]+/} onTextEdited: { fieldMatrecule.color = "black" } } Label{ text: qsTr("Nom :") Layout.fillWidth: true Layout.fillHeight: true } TextField{ id: fieldService Layout.fillWidth: true Layout.fillHeight: true text: qsTr("") validator: RegularExpressionValidator { regularExpression: /[0-9a-z A-Z]+/} onTextEdited: { fieldService.color = "black" } } Label { text: qsTr("Nom :") Layout.fillWidth: true //Layout.fillHeight: true } Rectangle{ id: rectService width: 150 height: 100 Layout.fillWidth: true Layout.fillHeight: true TextInput{ id: serviceAnterieure width: rectService.width-5 height: rectService.height Layout.fillWidth: true Layout.fillHeight: true wrapMode: TextArea.Wrap verticalAlignment: TextEdit.AlignHCenter maximumLength: rectService.height } } Label{ text: qsTr("Nom:") Layout.fillWidth: true Layout.fillHeight: true } TextField{ id: fieldResidence Layout.fillWidth: true Layout.fillHeight: true text: qsTr("") validator: RegularExpressionValidator { regularExpression: /[0-9a-z A-Z]+/} onTextEdited: { fieldResidence.color = "black" } } Label{ text: qsTr("Nom:") Layout.fillWidth: true Layout.fillHeight: true } TextField{ id: fieldNaissance Layout.fillWidth: true Layout.fillHeight: true text: qsTr("") validator: RegularExpressionValidator { regularExpression: /[0-9a-z A-Z]+/} onTextEdited: { fieldNaissance.color = "black" } } Label{ text: qsTr("Nom :") Layout.fillWidth: true Layout.fillHeight: true } TextField{ id: fieldTelephone Layout.fillWidth: true Layout.fillHeight: true text: qsTr("") validator: RegularExpressionValidator { regularExpression: /[0-9]+/} onTextEdited: { fieldTelephone.color = "black" } } Label{ text: qsTr("Nom :") Layout.fillWidth: true Layout.fillHeight: true } TextField{ id: fielMere Layout.fillWidth: true Layout.fillHeight: true text: qsTr("") validator: RegularExpressionValidator { regularExpression: /[a-z A-Z]+/} onTextEdited: { fielMere.color = "black" } } Label{ text: qsTr("Nom :") Layout.fillWidth: true Layout.fillHeight: true } ButtonGroup { buttons: column.children } Row { id: column spacing: 15 RadioButton { checked: true text: qsTr("Marie") onClicked: { if(checked) { stFamille = true } } } RadioButton { id:radioButtonCelibateur text: qsTr("Celibateur") onClicked: { if(checked) { stFamille = false } } } } Label{ text: qsTr("Nombre de(s) fille(s) :") visible: stFamille Layout.fillWidth: true Layout.fillHeight: true } SpinBox{ id: spinFilles value: 0 editable: true visible: stFamille Layout.fillWidth: true Layout.fillHeight: true } Label{ text: qsTr("Nombre de(s) garçon(s) :") visible: stFamille Layout.fillWidth: true Layout.fillHeight: true } SpinBox{ id: spinGarcons value: 0 editable: true visible: stFamille Layout.fillWidth: true Layout.fillHeight: true } } } Button{ id: btn icon.source: "qrc:/image/next.svg" Layout.alignment: Qt.AlignRight onClicked: { // stack.push("PageDetail.ui.qml") onVerifieData() } } } }
FYI I use QT 6.6