Qt Designer C++ or QML for GUI

clenemt picture clenemt · Jan 5, 2011 · Viewed 32.5k times · Source

I know that the use of QML is quite new in Qt and I was wondering if I should design my application using Qt Designer or QML. I will be using a MVC pattern and my main concern if I use QML for the GUI is that it might not be easy to integrate inside the rest of my C++ app.

Feel free to give your personal advice, I would greatly appreciate it. Thank you!

Answer

Steve S picture Steve S · Jan 6, 2011

QML is primarily intended for mobile platforms. Due to its youth and its concern for varied platform interface conventions, it lacks standard controls like buttons and combo boxes (but see the Components project). If you're on mobile, or your UI requires a highly customized visual style, QML might be worth considering. Be prepared for a lot of extra work in designing custom controls. Integrating QML and C++ is still pretty rough in my opinion. I would personally recommend using QML only for simpler apps, only on mobile platforms, and only with JavaScript. Under the right circumstances I might consider writing custom QML elements in C++.

Qt's C++ API isn't going away anytime soon. It's also designed with the desktop in mind and will do a better job of meeting user expectations on desktop platforms. If you're on the desktop, I would recommend sticking to C++ and Designer. Even after QML matures a bit, it probably won't be the right solution for most desktop apps.

Update!

It looks like things are beginning to change. I haven't tried the new components myself yet, and documentation seems a little sparse (or at least, out of the way), but this could eventually remove the greatest barrier to using QML on the desktop. It remains to be seen whether this will get support in the long term, but if you're willing to accept the risk of being an early adopter, I think QML may now be a viable choice for desktop apps.