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. Does Qt for iOS support retina display?
Forum Updated to NodeBB v4.3 + New Features

Does Qt for iOS support retina display?

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

    I'm creating my next app with Qt 5.2 for ios.

    I will create my customized ui on a QGraphicsScene. My main function so far looks very simple, I just create a QGraphicsScene and make it full screen:

    @
    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);

    MainGraphicsView mainGraphicsView;
    mainGraphicsView.setScene(new MainGraphicsScene());
    
    mainGraphicsView.showFullScreen();
    return a.exec();
    

    }
    @

    I print out the graphics view's size in the resizeEvent function:

    @
    QSize(198, 98)
    QIOSBackingStore needs to have the same size as its window
    QSize(638, 478)
    QSize(318, 566)
    @

    I'm using an iphone 5, the native resolution should be 640*1136, but what I printed from QGraphicsView is (318, 566).
    Notice that the resolution is (318,566), not (320,568), there are two missing pixels.

    I'm also worried about the warning "QIOSBackingStore needs to have the same size as its window".

    Question, does Qt for iOS support retina display?

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

      Try what size outputs in your main function.
      @
      QScreen *screen =a.primaryScreen();
      QSize size = screen->availableSize();@

      1 Reply Last reply
      0
      • B Offline
        B Offline
        billconan
        wrote on last edited by
        #3

        I tried, and got
        @
        screen size QSize(320, 548)
        @

        the height of the screen is 548 instead of 568. I guess that 20 pixels are for the status bar. but ios7 status bar seems to be difference now, because it becomes an overlay of the app ui. It shouldn't take up screen size.

        note that my QGraphicsView (318, 566) can be even larger than the screen size if made full screen. I kinda think it's the reason that I saw this warning:
        @
        QIOSBackingStore needs to have the same size as its window
        @

        1 Reply Last reply
        0
        • B Offline
          B Offline
          billconan
          wrote on last edited by
          #4

          After trying some other qt examples on iphone, I kinda think it's too early to seriously use Qt for an app.

          some examples are very slow at the moment.

          I wonder how it performs on Android. May be it's more suitable for android development.

          I really don't want to write two code bases.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sakrist
            wrote on last edited by
            #5

            You can get screen scale from window:
            @qwidget->windowHandle()->devicePixelRatio();@

            1 Reply Last reply
            0
            • X Offline
              X Offline
              Xander84
              wrote on last edited by
              #6

              I have used Qt Quick 2 for iOS and Android, and I can't say that it is slow, quite the opposite it is very fast compared to some Apps I've installed don the same device, maybe it is the QGraphicsScene or more likely what you display on it?!

              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