Responsive design for mobile app

  • 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?

    Thank you

  • Qt Champions 2017


    QRect rect = qApp->primaryScreen()->geometry();

    and see what it reports ? ( to find size)

  • I do not know where to place this code, i have imported QtWidget

    Thank you @mrjj

  • Qt Champions 2017

    Im not sure i understand.
    Inside your mainwindow widget or any other place that gets run.

    " imported QtWidget"

    is this QML ?

  • Hi,
    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:

    alt text

    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!


Log in to reply

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