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. QWidget for mobile dev?
Forum Updated to NodeBB v4.3 + New Features

QWidget for mobile dev?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 Posters 1.3k 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.
  • P Offline
    P Offline
    programDnger
    wrote on last edited by
    #1

    Hello there, so I am facing a dilemma for my project. I have developed a desktop app which is using Qt Widget and the most the GUI is done through C++ code and it is working perfectly. But my problem is that I want to use to same code and develop and mobile app for it. Doing so, I am running into the problem of screen resolution. The app is not automatically adapting to my mobile screen size. I am aware that Qt has QML which is for mobile app development but what if I want to keep the same look and feel by using QWidget. Does anyone know how I could make it to automatically fit my mobile? I am new a newbie in the Qt platform. THanks for your help

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mvuori
      wrote on last edited by
      #2

      Qt Widgets should be quite adaptive. First thing to check is that you don't specify any physical sizes or locations for the widgets, but place everything in a layout and let the layouts adapt to the small size.

      But if that doesn't work you may need to resort to setting rules if the screen is "small", like yourwidget->setMaximumWidth() and so on.

      1 Reply Last reply
      2
      • timdayT Offline
        timdayT Offline
        timday
        wrote on last edited by
        #3

        An iPad's logical pixel resolution is 768x1024 and an iPhone's is a few hundred by a few hundred. What happens if you set your desktop app to start up at that size? Is it doing the same as you're seeing on mobile? Note that if you perform your own pixel calculations, it's sometimes possible to get confused by details of HDPI (ie "retina") "device pixels" leaking into the "logical pixels" domain. I'd have hoped widgets were fairly immune to that though... more of a problem with native OpenGL.

        P 1 Reply Last reply
        0
        • timdayT timday

          An iPad's logical pixel resolution is 768x1024 and an iPhone's is a few hundred by a few hundred. What happens if you set your desktop app to start up at that size? Is it doing the same as you're seeing on mobile? Note that if you perform your own pixel calculations, it's sometimes possible to get confused by details of HDPI (ie "retina") "device pixels" leaking into the "logical pixels" domain. I'd have hoped widgets were fairly immune to that though... more of a problem with native OpenGL.

          P Offline
          P Offline
          programDnger
          wrote on last edited by programDnger
          #4

          @timday I manually did specify the resolution as you mentioned but it's adapting on the Iphone 7 plus but not on the 7. one is 5.5 and the other is 4.7 sadly

          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