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

Screen.height off by 80 pixels on iOS

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 385 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 24 Jan 2024, 17:34 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?

    J 1 Reply Last reply 24 Jan 2024, 19:39
    0
    • R RogueWarrior
      24 Jan 2024, 17:34

      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?

      J Offline
      J Offline
      JoeCFD
      wrote on 24 Jan 2024, 19:39 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 16 Feb 2024, 23:23
      0
      • J JoeCFD
        24 Jan 2024, 19:39

        @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 16 Feb 2024, 23:23 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.

        J 1 Reply Last reply 17 Feb 2024, 00:21
        0
        • R RogueWarrior
          16 Feb 2024, 23:23

          @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.

          J Offline
          J Offline
          JoeCFD
          wrote on 17 Feb 2024, 00:21 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