Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ScrollView Problem
Forum Updated to NodeBB v4.3 + New Features

ScrollView Problem

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 128 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • FortigaF Offline
    FortigaF Offline
    Fortiga
    wrote on last edited by
    #1

    Good evening everyone
    I'm working on a small project
    And I'm stuck on a small scrollview issue

    My problem is that the items don't take up all the available space

    Here is the program with Scrollview
    png.jpg

    And here's another one we delete scrollview

    png2.jpg

    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

    Juste pour aller de l'avant et apprendre des choses, lorsque vous voulez devenir une légende, cela ne se fait pas du jour au lendemain.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved