Does Qt for iOS support retina display?



  • 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?



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



  • 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
    @



  • 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.



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



  • 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?!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.