Ways to make qml design responsive
-
Hi,
I really am searching for an easy way to make a responsive qml design. I found the breakpoints plugin on figma but unfortunetly when I export it to qt designer studio I get a blank window regardless of everything in the window in the figma file. Have anyone found some easy way as I have tried hard-coding responsive qml and it is painful (at least for me) -
Hi
Not sure if it's the answer you're looking, I dont use Figma or any editor, I type all the code. I make responsive desings by using Flickable elements, anchoring, I use units in milimiters, insted of pixels, by using Screen.pixelDensity, and sizes based on windows percentage size. Sometimes I adapt the windows contents to the landscape or portrait mode. It's a bit of work typing all the stuff, but I got used to not using qmleditor, last time I tried, (long time ago), most values seem to be harcoded (or may it was just me that did not explore it enought), which breaks responsiveness. -
Hi, perhaps someone more experienced can give a more authoritative answer.
I would swear that bridge plugins are for when you are making layouts with a pre-set window size. Say a car or an embedded device. For all other applications, e.g. desktop / mobile i use:
- QtQuick.Layouts jugando con el Layout.MaximumWidth/Height and Layout.MinimumWidth/Height.
- For FontSize you can find the way that matches your style by searching here "Theme.qml" or "Style.qml" -> SourceGraph
Doc ref: Qt Scalability Page