Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Screen.height off by 80 pixels on iOS
Forum Updated to NodeBB v4.3 + New Features

Screen.height off by 80 pixels on iOS

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 461 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RogueWarrior
    wrote on last edited by
    #1

    I'm using Qt 6.5 and I'm discovering that the screen height number returned by Screen.height does correspond to the documented view port size for a given iPhone (e.g. 12 Pro). However, it seems to be off by 80 pixels. It might be due to the "safe area" height but I'm not sure. Can anyone shed some light on this? Is it a bug? Has this changed in 6.6? Does the same issue exist on Android?

    JoeCFDJ 1 Reply Last reply
    0
    • R RogueWarrior

      I'm using Qt 6.5 and I'm discovering that the screen height number returned by Screen.height does correspond to the documented view port size for a given iPhone (e.g. 12 Pro). However, it seems to be off by 80 pixels. It might be due to the "safe area" height but I'm not sure. Can anyone shed some light on this? Is it a bug? Has this changed in 6.6? Does the same issue exist on Android?

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #2

      @RogueWarrior In the following way you can get full screen display. Then you can get the right screen size.

      ApplicationWindow {
          id: mainAppWindow
          visible: true
          visibility: Window.FullScreen
      
      R 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        @RogueWarrior In the following way you can get full screen display. Then you can get the right screen size.

        ApplicationWindow {
            id: mainAppWindow
            visible: true
            visibility: Window.FullScreen
        
        R Offline
        R Offline
        RogueWarrior
        wrote on last edited by
        #3

        @JoeCFD I'll try that. I'm working on an Android version and the full screen mode is nice in that the bottom toolbar isn't always there but I'm now noticing that the same code on Android is doing weird things. Not only is the screen height off by 20 pixels but the value Screen.height is actually changing on the fly. On a Samsung Galaxy phone, the value starts out at 730 but then a few seconds after the main window appears on launch, the value jumps to 800. So far, I can't see any reason why this would happen.

        It really obvious because I have an element anchored to the bottom edge.

        JoeCFDJ 1 Reply Last reply
        0
        • R RogueWarrior

          @JoeCFD I'll try that. I'm working on an Android version and the full screen mode is nice in that the bottom toolbar isn't always there but I'm now noticing that the same code on Android is doing weird things. Not only is the screen height off by 20 pixels but the value Screen.height is actually changing on the fly. On a Samsung Galaxy phone, the value starts out at 730 but then a few seconds after the main window appears on launch, the value jumps to 800. So far, I can't see any reason why this would happen.

          It really obvious because I have an element anchored to the bottom edge.

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4

          @RogueWarrior I guess the gap is the title area height in Android. Therefore, Screen.height is kind of misleading.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved