OverviewFelgo 2 Support (Qt 5) › window size change runtime customize

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #16080




    is it posible to change the window size list, so i could add custom sizes?




    Felgo Team

    Hi Bas,

    we do not allow to modify the debug menu bar with custom resolutions at the moment.

    But you can implement your own solution with a small workaround:

    import Felgo 3.0
    import QtQuick 2.0
    import QtQuick.Window 2.2
    App {
      id: app
      // resize window on button click
      AppButton {
        text: "Resize Window"
        // properties of new target device (e.g. values that match iPhone 6)
        property real deviceWidth: 750
        property real deviceHeight: 1334
        property int deviceDpi: 326
        // set new window size and uiScale on button click
        onClicked: {
          // calculate scale-factor to fit window on screen if width/height too big for screen (for landscape or portrait)
          var targetWidth = app.width < app.height ? deviceWidth : deviceHeight
          var targetHeight = app.width < app.height ? deviceHeight : deviceWidth
          var windowScale = Math.min(Math.round(Screen.desktopAvailableWidth * 0.9) / targetWidth, Math.round(Screen.desktopAvailableHeight * 0.9) / targetHeight, 1.0)
          // set new size and uiScale
          app.setScreenSize(Math.round(targetWidth * windowScale), Math.round(targetHeight * windowScale)) // resize window
          app.uiScale = deviceDpi / (Screen.pixelDensity * 25.4) * windowScale // resize UI to match device dpi




Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
create apps
create games
cross platform
native performance
3rd party services
game network
level editor
easiest to learn
biggest time saving
best support