I am new to QML.
As I understand, all elements have an associated width and height which determines their size.
If the user changes screen resolution, the final output looks weird.
Is there a way the size of elements could be controlled dynamically based on screen resolution?
I am new to QML. As I understand, all elements have an associated width
Share
Instead of using fixed values, you can multiply
heightandwidthof the root element by factors, that determine the size of your elements proportional to the root elements size. Additionally you can use QML anchors. With this you can create completely scalable GUIs:I dont know a way to get the screen resolution with pure QML that is available at all environments.
To determine the screen resolution on mobile devices you can use the QML Screen Element.
In desktop applications you can get the screen resolution in C++ (e.g. with QDesktopWidget) and make it available in QML.