Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Responsive design for mobile app
Clody21 last edited by
Hello I would like to know how to set up a responsive layout on mobile devices (Android, Ios).
I'm implementing a login page, so with a box that needs to be centered and with two input texts and one key, I can not figure out the size of the phone (portrait, landscape).
Does anyone have an example, or can they indicate a technique?
QRect rect = qApp->primaryScreen()->geometry();
and see what it reports ? ( to find size)
Clody21 last edited by Clody21
I do not know where to place this code, i have imported QtWidget
Thank you @mrjj
Im not sure i understand.
Inside your mainwindow widget or any other place that gets run.
" imported QtWidget"
is this QML ?
GTDev last edited by GTDev
You might want to take a look at V-Play Engine for QML-based mobile apps and games. V-Play offers many components for creating cross-platform apps that automatically adapt their layout and UI to match the native iOS and Android user experience.
V-Play comes with many open-source examples and project templates you can use as reference (there's also a template for a simple login-page). For an overview of the most important features, you can have a look at the Component Showcase demo:
To quickly learn the basic concepts you can have a look at some tutorials, for example Supporting Multiple Screens Sizes and Densities with V-Play Apps.
Hope this helps!