Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt 6.4.x on iPhone with notch: Mouse coordinates and save area

Qt 6.4.x on iPhone with notch: Mouse coordinates and save area

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 187 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.
  • T Offline
    T Offline
    TheoSys
    wrote on last edited by TheoSys
    #1

    Hi,

    while porting an application from Android to IOS I found out, that the reported mouse coordinates doesn't match the save area. The mouse coordinate 0,0 is the top left pixel of the save area minus the notch size. Is this wilful?
    I ask this because on Android it behaves different. There I must not take care about any notch sizes although this exists on Android devices too.

    For anybody encountering the same problem, I have a solution for this. If you assume the upper left corner in the save area is pixel 0,0 then you mus subtract the size of the notch from it. Here is a small objective-c code example of how to get the notch size (area on top and bottom of screen when in portrait mode or left, right and bottom if in landscape mode):

    int getCurrentOrientation()
    {
        UIDevice *device = [UIDevice currentDevice];
    
        if (!device)
            return -1;
    
        return [device orientation];
    }
    

    Look at Apple developper/orientation for the meaning of the resulting values.
    Calll the above method after your application received the active status signal.

    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