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. Create an application that respect whatever the inch of a device

Create an application that respect whatever the inch of a device

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 3 Posters 971 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.
  • L Offline
    L Offline
    le_fonceur
    wrote on last edited by
    #1

    Hello everybody,

    I'm so very proud to be in this forum. Its motivate me to continue to learn Qt. Yesterday, i install my first small app on my tablet, i was very glad. Today, i worked a lot in order to know more. I have 1 questions :
    How can i set my app in order to respect any inch of a device. I install my first app in my tablet(Archos 8o Xenon 8''), the mainform respect he screen. When i install it in my Samsung Galaxy, i can not see some components. Can someone explain me that? Please.

    Thak you

    1 Reply Last reply
    0
    • benlauB Offline
      benlauB Offline
      benlau
      Qt Champions 2016
      wrote on last edited by
      #2

      In order to support different screen resolution and keep UI be consistent , Android recommends a cross device Density-independent pixel , dp , to replace pixel as the display unit for UI component.

      http://developer.android.com/guide/practices/screens_support.html

      The concept of DP is quite similar to DPI but its value is simplified in range of 0.75,1,1.5,2,3 etc.

      Unfortunately QT do not provide the DP unit yet. You need to handle by yourself and use library like this one:

      https://github.com/benlau/quickandroid

      Check the example could see how it works.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        s.frings74
        wrote on last edited by
        #3

        If it is a widget application:

        then use layouts and forget the graphical dialog designer. Better create the whole content by source code. Use nested layouts to arrange things horizontally, vertically or int able form. Avoid to set any position or size because these values are pixels.
        In some rare cases where position/size parameters cannot be avoided, make them relative to the font size.

        Example: if a text editor field has a size of 300x200 pixels it might look fine on most desktop computers. But many mobile devices have a much higher screen resolution, so the text editor appears too small.

        But if you say, the size of the text editor is width=20*fontSize, height=15xfontsize, then it looks fine on any display.

        But this is not possible in the graphical designer tool.

        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