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 in android
Forum Update on Monday, May 27th 2025

resolution in android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
10 Posts 3 Posters 1.5k 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.
  • J Offline
    J Offline
    Joao Alysson
    wrote on last edited by
    #1

    I am developing an application in qt and I came across the following problem: when giving run or build and run the application in android I noticed that the buttons, combobox and other components are appearing in the cell asymmetrically, I wonder if there is how to solve, and do for various resolutions ???

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      A screenshot would be helpful, and some code, then we can diagnose better.

      Are you using QtQuick Controls 1 or 2? Are you using layouts? Are you using custom fonts?

      Does it also look asymmetrical when you build for desktop?

      (Z(:^

      1 Reply Last reply
      2
      • J Offline
        J Offline
        Joao Alysson
        wrote on last edited by
        #3

        1_1525188873304_Capturar.JPG 0_1525188873304_01.JPG

        in desktop1_1525188948746_Capturar.JPG 0_1525188948746_01.JPG 0_1525188963218_01.JPG 0_1525189008014_01.JPG 0_1525189018476_01.JPG

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Joao Alysson
          wrote on last edited by
          #4

          0_1525189670968_teste.JPG in abdroid, emulator memu

          jsulmJ 1 Reply Last reply
          0
          • J Joao Alysson

            0_1525189670968_teste.JPG in abdroid, emulator memu

            jsulmJ Online
            jsulmJ Online
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Joao-Alysson Do you use layouts?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              So the problem is that these labels (Kc1, Kc2 etc.) should be centered above the input fields, right?

              That indeed might be (slightly) dependent on resolution and (much more) on the font. But still, it should be possible to center them pretty nicely. Are you using QtWidgets or QtQuick for your UI?

              If QtQuick, then try something like this:

              ColumnLayout {
                Text { // Or Label
                  text: "Kc1"
                  horizontalAlignment: Text.AlignHCenter
                  Layout.alignment: Qt.AlignHCenter
                }
                TextInput {
                  // ...
                }
              }
              

              (Z(:^

              1 Reply Last reply
              0
              • J Offline
                J Offline
                Joao Alysson
                wrote on last edited by
                #7

                @sierdzio i like in yhe android im using qt creator is an app query, you change the parameters example: avocado, play the parameters in the textlist, just wanted to be adaptable, on my phone and a lg k4 and works on the screen all the same in the first image, already in the emulator memu, he cut the parameters, do not display everything!

                1 Reply Last reply
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  Oh you mean that you don't see the button etc. So this is not about being centered at all.

                  There are many ways to fix this issue (I still don't know if you are using widgets or qml, I'm assuming QML even though I suspect otherwise):

                  • place your UI inside a Flickable component, to allow users to scroll your UI on smaller screens
                  • make sure your app is run in fullscreen mode and that your layout (you are using layouts, right?) does not exceed the window size
                  • set smaller minimal / preferred sizes for your components so that they fit on smaller screens
                  • if the UI does not fit, hide some components, or move them to next page or something

                  (Z(:^

                  J 1 Reply Last reply
                  0
                  • sierdzioS sierdzio

                    Oh you mean that you don't see the button etc. So this is not about being centered at all.

                    There are many ways to fix this issue (I still don't know if you are using widgets or qml, I'm assuming QML even though I suspect otherwise):

                    • place your UI inside a Flickable component, to allow users to scroll your UI on smaller screens
                    • make sure your app is run in fullscreen mode and that your layout (you are using layouts, right?) does not exceed the window size
                    • set smaller minimal / preferred sizes for your components so that they fit on smaller screens
                    • if the UI does not fit, hide some components, or move them to next page or something
                    J Offline
                    J Offline
                    Joao Alysson
                    wrote on last edited by
                    #9

                    @sierdzio I use c ++, it's just that in a resolution it gets full in another cut wanted to be able to screen

                    1 Reply Last reply
                    0
                    • sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #10

                      No this is not (only) about resolution. If you build the UI in a responsive way, it will fit any (reasonable) screen size and resolution.

                      So, if you're using widgets, try meddling with size policy and making a tighter layout. There is plenty of unused screen estate in your Android screenshot.

                      (Z(:^

                      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