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. How to make all elements in the Grid to fit in the screen?
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 873 Views 2 Watching
  • 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.
  • vishnuV Offline
    vishnuV Offline
    vishnu
    wrote on last edited by vishnu
    #1

    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....
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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