Important: Please read the Qt Code of Conduct -

QML generic multi-page template ?

  • I am trying to write an QML application that can run on different screen sizes (iphone, desktop, android, iPad, etc..) and has multiple pages.

    • are there any 'templates' out there that auto-resize to the different screen sizes ? or do i need to pass them in using a QQmlContext in c++ ?

    • how is this normally done ?

    i've setup something that uses a StackView to load pages on demand, but am running into problems that the page sizes don't seem to match the main page unless i hard code the width, height and sometimes ever need to specify a hard coded x location for images.

  • Moderators

    Hi @clogwog
    Use Screen to get the Screen's deimesions. Bind the width and height of root element to it.