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. App looks fine on Desktop, but not iOS emulator
Forum Update on Monday, May 27th 2025

App looks fine on Desktop, but not iOS emulator

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 3 Posters 1.4k 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.
  • A Offline
    A Offline
    asundar
    wrote on last edited by
    #1

    The emulator is trying to look exactly like the Desktop app, instead of resizing all the images to make it proportional, I guess like an autofit. Anyone have an idea on how I can achieve this?

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

      It is your responisibility to make the images resize as you wish to, there are some helper classes available. Qt does not do that automatically. The idea in Qt is to have something look the same on all platforms.

      (Z(:^

      1 Reply Last reply
      0
      • metaDomM Offline
        metaDomM Offline
        metaDom
        wrote on last edited by
        #3

        you should define all based on screen values gathered due runtime. i use the following way, after initiliazing the ui (ui->setupUi(this);):

        @screen = QGuiApplication::screens().first();
        connect(screen, SIGNAL(virtualGeometryChanged(QRect)), this, SLOT(setSizes()));@

        @void MainWindow::setSizes()
        {
        int height = screen->availableSize().height();
        ui->backButton->setIconSize(QSize(height/10, height/10));
        ui->menuButton->setIconSize(QSize(height/10, height/10));
        }@

        Looks great on any device size, tho I do allow the user to modify the values later via settings. You can use a modified function to apply it to images or whatever...

        1 Reply Last reply
        0
        • A Offline
          A Offline
          asundar
          wrote on last edited by
          #4

          [quote author="dominik.fehr" date="1407944460"]you should define all based on screen values gathered due runtime. i use the following way, after initiliazing the ui (ui->setupUi(this);):

          @screen = QGuiApplication::screens().first();
          connect(screen, SIGNAL(virtualGeometryChanged(QRect)), this, SLOT(setSizes()));@

          @void MainWindow::setSizes()
          {
          int height = screen->availableSize().height();
          ui->backButton->setIconSize(QSize(height/10, height/10));
          ui->menuButton->setIconSize(QSize(height/10, height/10));
          }@

          Looks great on any device size, tho I do allow the user to modify the values later via settings. You can use a modified function to apply it to images or whatever...[/quote]

          Apologies as I'm really raw to QT. What are screen, backButton, and menuButton? When i make the setSizes function, it would be whatever my project name is::setsizes()?

          1 Reply Last reply
          0
          • metaDomM Offline
            metaDomM Offline
            metaDom
            wrote on last edited by
            #5

            screen is a QScreen object.

            @QScreen *screen;@

            backButton and menuButton are QPushButtons, implemented via the QtDesigner.
            If you are working with the designer, you can reach any UI element via:

            ui->[ui object name]

            setSizes is a function of my main class, aka MainWindow. You need to modify the function for your needs, the only important thing I wanted to show is that you need to work with the available screen size of your device to make your app fit :)

            Best regards

            1 Reply Last reply
            0
            • A Offline
              A Offline
              asundar
              wrote on last edited by
              #6

              I've gotten the code to work, but it looks weird. How do I get the dimensions to this?!http://i.imgur.com/PkrrWEq.png()!

              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