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. How to check if the application is being loaded into a phone screen or a tablet screen?
Forum Updated to NodeBB v4.3 + New Features

How to check if the application is being loaded into a phone screen or a tablet screen?

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 4 Posters 1.5k 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.
  • M Offline
    M Offline
    mshefiti
    wrote on last edited by
    #1

    I am building a unified display UI, where I have to check if the device which is using the app is a phone (small display), or a tablet (bigger display).

    If its a phone, it will hide some content (as there is not enough space), while if its a tablet it will show the whole content.

    How can I check this?

    Lets say, in both versions the app will be load in Portrait Mode.

    Thanks guys!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What platform are you targeting ? iOS ? Android ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • GianlucaG Offline
        GianlucaG Offline
        Gianluca
        wrote on last edited by
        #3

        Use the QScreen, check the physical dimension (not the pixel resolution) of the screen and determine the break point where you consider a device a tablet or a phone.
        Take into account that there is no such real difference between a tablet and a phone.
        So, if you suppose that a tablet is something that has more than 7'' display, then calculate the screen dimension from QScreen and if it's above 7'' you display the tablet UI, otherwise the phone UI.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mshefiti
          wrote on last edited by
          #4

          [quote author="SGaist" date="1417553970"]

          What platform are you targeting ? iOS ? Android ?[/quote]

          Hi SGaist, I am making a cross-platform application that targets anything with a touch screen in the Operating Room. However I am starting with a phone/tablet prototype, and it targets both platforms.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mshefiti
            wrote on last edited by
            #5

            Gianluca, thank you for your suggestion. Sounds great! I will totally try that.

            Thank you again!

            1 Reply Last reply
            0
            • F Offline
              F Offline
              feldifux
              wrote on last edited by
              #6

              Hi,
              you can also see this blog post we recently published about supporting multiple screens with Qt:
              http://v-play.net/2014/11/supporting-multiple-screen-sizes-and-screen-densities-with-qt-and-v-play/

              We added a property "tablet":http://v-play.net/doc/vplay-gamewindowapplicationwindow/#tablet-prop, which sounds like it is doing what you are looking for..

              Cheers,
              Chris

              Founder of Felgo SDK - http://felgo.com/qt

              Felgo simplifies

              • Mobile App Dev with Qt esp. iOS & Android
              • Game Development with Qt

              What others say

              Felgo scored #1 in Cross-Platform App Development Tools Report - see why: https://goo.gl/rgp3rq

              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