Qt World Summit: Register Today!

Does QT have any way of "knowing" which plataform is being used?

  • Hi, I'm doing a project that works on both desktop and mobile, the problem is... How can I tell QT that the project is running on desktop or mobile? The screen design is different between desktop and mobile, and, as we know, the size / resolution between a pc and a mobile phone can be very different, making automatic resizing very difficult. So is there any way for QT to know when it's mobile or desktop?

  • Lifetime Qt Champion

    Since the exe of a Desktop will be different than the exe for a phone then normally one uses
    #ifdef Q_OS_ANDROID


    etc to have platform dependant code so it's only compiled in when app is compiled for that platform.

    full list here

Log in to reply