Results 1 to 10 of 10

Thread: Android App Visual elemts are displayed very small

  1. #1
    Join Date
    May 2015
    Posts
    12
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Android App Visual elemts are displayed very small

    Hi,
    I'm new to Android Programming. I created a small App which should display texts and some buttons.
    Everything seems to work but the fonts are buttons are dispalyed just extreme small. And you can't even see the whole text.


  2. #2
    Join Date
    May 2015
    Location
    Brazil
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Windows Android

    Default Re: Android App Visual elemts are displayed very small

    Hi Reiji,

    Are you using layouts?
    See documentation here.
    Layout describes how widgets are laid out in an application's user interface, so in order to get the widgets showed in the available space use any Layout in your .ui or programmatically in the .cpp.

    Wilkinson Tavares

  3. #3
    Join Date
    May 2015
    Posts
    12
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Android App Visual elemts are displayed very small

    Now it fits my display on my android device. I just need to design in a very big size at the computer.
    Last edited by Reiji; 26th May 2015 at 13:21.

  4. #4
    Join Date
    May 2015
    Location
    Brazil
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Windows Android

    Default Re: Android App Visual elemts are displayed very small

    Sure,
    This video shows how to do it in the cpp.
    If you're using Qt Creator and you have a form file (.ui), in the design mode it has Layouts on the left sidebar, just drag and drop one of them and put the widgets you want inside it.
    Best regards

  5. The following user says thank you to wtfm for this useful post:

    Reiji (26th May 2015)

  6. #5
    Join Date
    May 2015
    Posts
    12
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Android App Visual elemts are displayed very small

    My phone has a big resolution but not my screen of my computer. Does anyone know if there is a possibility to let fit the application at every phone screen resolution (not only for my phone resolution)?
    Last edited by Reiji; 26th May 2015 at 15:00.

  7. #6
    Join Date
    May 2015
    Posts
    12
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Android App Visual elemts are displayed very small

    Quote Originally Posted by wtfm View Post
    Hi Reiji,

    Are you using layouts?
    See documentation here.
    Layout describes how widgets are laid out in an application's user interface, so in order to get the widgets showed in the available space use any Layout in your .ui or programmatically in the .cpp.

    Wilkinson Tavares
    Even with layouts it looks very small on big resolution screens.


    big.jpg
    small.jpg

  8. #7
    Join Date
    May 2015
    Location
    Brazil
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Windows Android

    Default Re: Android App Visual elemts are displayed very small

    Quote Originally Posted by Reiji View Post
    My phone has a big resolution but not my screen of my computer. Does anyone know if there is a possibility to let fit the application at every phone screen resolution (not only for my phone resolution)?
    Hi Reiji,

    You should use some kind of density-independent pixel (dp) to get an application that displays properly in an range of resolutions.
    See Qt documentation here.
    Calculating Scaling Ratio
    You can select one high DPI device as a reference device and calculate a scaling ratio for adjusting image and font sizes and margins to the actual screen size.
    See Android guides here.

    EDIT:
    However Reiji, your problem may be a lack of a layout in your central widget or this.
    Last edited by wtfm; 27th May 2015 at 12:44.
    Best regards

  9. #8
    Join Date
    May 2015
    Posts
    12
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Android App Visual elemts are displayed very small

    Quote Originally Posted by wtfm View Post
    Hi Reiji,

    You should use some kind of density-independent pixel (dp) to get an application that displays properly in an range of resolutions.
    See Qt documentation here.
    Calculating Scaling Ratio
    You can select one high DPI device as a reference device and calculate a scaling ratio for adjusting image and font sizes and margins to the actual screen size.
    See Android guides here.

    EDIT:
    However Reiji, your problem may be a lack of a layout in your central widget or this.
    I'm just new to this. Is there any tutorial?
    Last edited by Reiji; 28th May 2015 at 12:45.

  10. #9
    Join Date
    May 2015
    Location
    Brazil
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Windows Android

    Default Re: Android App Visual elemts are displayed very small

    Quote Originally Posted by Reiji View Post
    I'm just new to this. Is there any tutorial?
    Not that I know of, but is pretty simple.
    Read the documentation that I posted above to get a clue, mainly the scaling ratio part, and this post can help you as well.
    Best regards

  11. #10
    Join Date
    May 2015
    Posts
    12
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Android App Visual elemts are displayed very small

    I'm useing a QT Widget(C++) and for the interface an ui file created with the Formdesigner. So how can I use the dp thing which is written in qml?

Similar Threads

  1. Qt Controls so small on Android
    By pliniofernando in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 27th July 2014, 00:59
  2. Replies: 4
    Last Post: 10th July 2014, 15:22
  3. Android ARM vs Android x86 in qmake .pro file
    By sedi in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2014, 08:48
  4. Android QMessageBox rich text is not displayed correctly
    By maitai in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 31st January 2014, 16:44
  5. How do you make android applications display correctly on android phone?
    By Cyrebo in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 17th August 2013, 07:31

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.