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. Resolution problem for an Android application
Forum Updated to NodeBB v4.3 + New Features

Resolution problem for an Android application

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 297 Views 1 Watching
  • 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.
  • G Offline
    G Offline
    Giovanni Goloso
    wrote on last edited by
    #1

    Hello everyone,

    I am developing an Android application using Qt Creator (a Qt widget with Qt 6.5) that will run only on a specific defined tablet (SAMSUNG with a resolution of 1920x1200). I would like to specify the dimensions of the components placed in the editor as actual pixel values of the tablet. Currently, if I specify, for example, a button of 500px x 500px, it gets scaled according to the DPI, becoming much larger and different from the same application running on Windows. How can I avoid this effect (which is not useful in my case)?

    Thank you!

    KH-219DesignK 1 Reply Last reply
    0
    • G Giovanni Goloso

      Hello everyone,

      I am developing an Android application using Qt Creator (a Qt widget with Qt 6.5) that will run only on a specific defined tablet (SAMSUNG with a resolution of 1920x1200). I would like to specify the dimensions of the components placed in the editor as actual pixel values of the tablet. Currently, if I specify, for example, a button of 500px x 500px, it gets scaled according to the DPI, becoming much larger and different from the same application running on Windows. How can I avoid this effect (which is not useful in my case)?

      Thank you!

      KH-219DesignK Offline
      KH-219DesignK Offline
      KH-219Design
      wrote on last edited by
      #2

      @Giovanni-Goloso I ran into this same struggle a couple years ago.

      I don't know if anyone has a better idea these days. (I would love to see if you get any other helpful replies). The tactic that I "invented" back then is described in the following StackOverflow answer:

      https://stackoverflow.com/a/67511920/10278

      As I explain on that StackOverflow post, I based my solution on this part of the Qt docs:

      http://web.archive.org/web/20210511233243/https://doc.qt.io/qt-5/scalability.html#calculating-scaling-ratio

      www.219design.com
      Software | Electrical | Mechanical | Product Design

      G 1 Reply Last reply
      1
      • KH-219DesignK KH-219Design

        @Giovanni-Goloso I ran into this same struggle a couple years ago.

        I don't know if anyone has a better idea these days. (I would love to see if you get any other helpful replies). The tactic that I "invented" back then is described in the following StackOverflow answer:

        https://stackoverflow.com/a/67511920/10278

        As I explain on that StackOverflow post, I based my solution on this part of the Qt docs:

        http://web.archive.org/web/20210511233243/https://doc.qt.io/qt-5/scalability.html#calculating-scaling-ratio

        G Offline
        G Offline
        Giovanni Goloso
        wrote on last edited by
        #3

        @KH-219Design Hello and thank you for the response. I have read and tried the solution you provided carefully, but it's not exactly what I'm looking for. Let me explain why:

        I need to render images on the screen, for example, 1000px by 500px. With your solution, I would have to scale these images by the 'm_extentsRatio' factor (sampling) and let Android then scale them to the actual 1000px by 500px (interpolation). We are developing critical systems, and interpolation is not allowed.

        It seems to me that Android applies this scaling downstream based on DPI. I need to completely disable it for my application written in Qt, but unfortunately, I can't find anything! =(

        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