How to make all elements in the Grid to fit in the screen?



  • Hello Everybody,
    I have divided the whole screen into 4 rectangels. Header, body into 2, footer.

    Now in the 2 nd rectangle from top. I have a grid with some elements as shown in fig. The problem is, the width of the screen is not enough to show all the data elements in Android. Can you please tell me what is the recommended procedure inorder to fit all the data elements in the screen. Thanks a lot.

    screenshot

    P.S: Android screen is locked in protrait mode.

    Code:
    Header and footer are in separate qml file.

    body.qml // this is pushed into the stack using stackview. so the width and height are filled by stackview.

    Rectangle {
        id:root
        width: 100
        height: 62
    Rectangle{
            id:buttonsroot
            height: parent.height/7
            width: parent.width
            Item {
                anchors.left: parent.left
                anchors.top: parent.top
                anchors.leftMargin: 20
                anchors.topMargin: 4
                GridLayout{
                    //                horizontalItemAlignment: Grid.AlignHCenter
                    //                verticalItemAlignment : Grid.AlignTop
                    columns: 10
                    rows: 3
                    columnSpacing: 4
                    rowSpacing: 1
                    // Layout.fillWidth:true
    
                    ExclusiveGroup{id:modeselection}
                    RadioButton{
                        id: manualbutton
                        text: "Manual"
                        checked: true
                        onCheckedChanged: {
                            startRecordingButton.enabled= manualbutton.checked                       
                        }
    
                        exclusiveGroup: modeselection
                    }
                    Button{
    ....other elements like this....
    

  • Lifetime Qt Champion

    Hi,

    One way would be to have a ScrollView so you can move things from left to right or redesign that part to only show the selected option widgets and exploit all the available place.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.