Qml Mobile Dynamic (or Responsive) Design



  • Hi; I want to dynamic (or responsive) design with Qml for mobile apps. (Image Link). But I want to align right Button 2 and I want to dynamic (or responsive) design with Qml. How can I do that? Thanks.



  • Use a spacer most of the time it works. There are

    Layout.alignment: Qt.AlignLeft|AlignRight|etc which is an option but in some occasions doesn't follow through. Then there's a simple spacer doing (which you will put before the buttons you want to push to the right.

    Item {
    id: spacer
    Layout.fillWidth: true // will use up the rest of the space available, contrast to the other buttons that are normally fixed.
    Layout.fillHeight: true
    }
    

    As for dynamic response you could detect the width/height to act on it, and use the Loader type, thing is you will also need to keep track of user input and re-bind them as well. I'm no expert in the subject, having tried it to be dynamic response it can be quite a pain.


Log in to reply
 

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