Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › Stretch several buttons on device width

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #22882

    Anatol

    What is the standard way of stretching several buttons/ rectangles on full device width?

     

    I tried to use anchors and Column/Row in my example.

            Page {
                title: qsTr("Page")
    
                Column {
                    id: contentControl
                    anchors.left: parent.left
                    anchors.top: parent.top
                    anchors.right: parent.right
                    anchors.bottom: parent.bottom
                    Row {
                        spacing: 2
                        anchors.left: parent.left
                        anchors.top: parent.top
                        anchors.right: parent.right
                        Rectangle {
                            id: rectangle1
                            anchors.left: parent
                            width: (parent.width-2)/2
                            height: dp(100)
                            color: "#990000"
                            radius: 2
                        }
                        Rectangle {
                            id: rectangle
                            //anchors.right: parent
                            width: (parent.width-2)/2
                            height: dp(100)
                            color: "#009900"
                            radius: 2
                        }
                    }
    
                }
    
            }

     

     

    Layout alignment I want to create:

    1             2

    3             4

     

    1             2             3

    4             5             6

    7             8             9

     

     

     

    Regards

    #22899

    Alex
    Felgo Team

    Hi,

    you could use a Grid or GridLayout and calculate the number of used columns depending on the device width.

    Another approach would be using the Flow item.

    Cheers,
    Alex

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded