Which is the most portable "flavor" of Qt (Pure C++, QML/C++, QML/Javascript, etc.)?

  • I'm hoping to start working on a project using Qt, which I would ideally like to deploy on the desktop and as an Android app, and possibly an iOS app too. Now that Qt Quick exists, there are a number of ways to write a program using Qt: C++ with standard widgets, QML with C++, QML with Javascript only... which of these is the most portable given the platforms I'm hoping to deploy on? Or am I missing one that would be preferable?

  • Moderators

    All of those are equally supported on desktop OSes, Android and (not sure 100% here) iOS.

    If you consider Symbian, too, then widgets are a no-go (but please, verify that with someone else, I've never had any Symbian devices).

  • I can't really address the QML vs. standard widgets question as I haven't used QML enough, but here are my thoughts on JS vs. C++:

    Trying to code for iOS with anything but Objective C gets super ugly, super quick, so I'd suggest pure C++ with some sort of ObjC++ wrapper for iOS as the most portable. I know people have coded iOS apps in JavaScript before though, so I suppose it's a possibility.

    Symbian and C++ Qt were quite literally made for each other... Symbian belle even includes (a part of) C++ Qt as part of the firmware. Standard widgets are most definitely possible, but so is Qt Quick. I wouldn't bank on Javascript though.

    Desktop and Android, AFAIK, should all work beautifully with any of the options you gave.

    So all in all, C++ is king for portability, but then you probably already knew that. Question is, do you want to go into all the hassle involved with that kind of low-level language if Javascript probably works equally well on most platforms :)

  • [quote author="sierdzio" date="1342969372"]All of those are equally supported on desktop OSes, Android and (not sure 100% here) iOS.

    That is simply not true, the last two we all know aren't really "supported" and the community ports are incomplete, laden with broken or missing features.

    On the subject of which is more portable - If a platform supports native C++ Qt, it is likely to also support QML, which is merely an API written in C++. That being said, with QtQuick2 there is a requirement for OpenGL and plenty of stuff is done in hardware, which might be a portability issue, whereas in C++ you can stick to doing everything in software, which is the case of QtQuick1 as well.

    Both the Android NDK and the apple SDK support native C++, so even if Qt is not supported you can still write the core of your app in C++ and just do different frontends in the target device native framework.

    Best case scenario for portability is you write your application and that's all, no extra efforts are needed to run it on different platforms, but for Qt this applies only to desktop platforms, and not always 100%. If your application is simple you might have better chances going for the HTML/JS combo, which is more portable.

Log in to reply

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