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. super small resolution on android app
Forum Updated to NodeBB v4.3 + New Features

super small resolution on android app

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 3 Posters 675 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.
  • H Offline
    H Offline
    Hrovac
    wrote on last edited by
    #1

    I'm new to Qt.

    i created a simple app for android.

    The resolution of my test android device is 1080 x 2400.
    But the resolution of the app is somewhat 468x1000.

    How do i use the full resolution?

    I tried some settings with screen.width ..
    but it didnt work.

    code:

    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtQuick.Controls 2.15
    
    ApplicationWindow {
        id: root
        width: 1080
        height: 2160
        //minimumWidth: Screen.width
        //minimumHeight: Screen.height
        //visibility: Window.FullScreen
        visible: true
        title: qsTr("Hello World")
    
        Rectangle{
            width: 468
            height:1000
            color:"red"
        }
    }
    

    Is this a feature of a highDPI-Scaling ? if yes, how to disable it?

    Or do i have to specify the resolution somewhere else? AndroidManifest - for example`?

    Thank you.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bee65
      wrote on last edited by
      #2

      The coordinate system in QML is not the same as the device pixels on the screen. The coordinates are floating point numbers and text and graphics are drawn using the full resolution of the device, no matter how you transform the coordinates. If you want to use pixel resolution for displaying an image resource, you can use QScreen::physicalDotsPerInch() etc to scale it to the right size. But it is better to make everything in your app scalable to work at any resolution.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Hrovac
        wrote on last edited by
        #3

        thank you for your explanation. i totally agree with making everything scalable.
        but for example
        if i load a small image with 512x512 px its close to fullscreen
        or
        if i draw a rectangle with border.width:1 the border is super bold.

        to me it feels like the whole ui is upscaled 250% - that is to much.
        the upscaling is a nice feature but should be optional.

        so, can we somehow change this upscaling?

        thank you.

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Hrovac
          wrote on last edited by
          #4

          okay, after reading your comment again:

          The coordinate system in QML is not the same as the device pixels on the screen.

          I recognised my misconception. The use of "px" for defining the width and height of elements was misleading for me.

          But, having width: 472 and height: 1016 of available space on my device seems arbitrary to me.
          I get it, that i should always use scalable layouts - not specififc values, but still.

          1 Reply Last reply
          0
          • TomZT Offline
            TomZT Offline
            TomZ
            wrote on last edited by
            #5

            I design my application in 360 x 720. Which makes the application look the same on all phones. Regardless of actual number of pixels of the screen.

            The advantage is that you can use pixels for your design. Spacing is 10 pixels between components, for instance. Those are not real pixels, so the spacing will look the same on all devices.

            Please do notice this is using Qt6.

            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