Tuesday, May 21, 2013

Ubuntu Switching to QT

So you may have already heard the news that Ubuntu will be switching to Qt as the primary graphical toolkit for Unity. This will be for the next edition of Unity, which is called, appropriately, "Unity Next." The intent is to have a unified OS across platforms, and match the desktop to Ubuntu's mobile version, which is already built on Qt. This change is planned to be in place by the next LTS version, 14.04.

Not much detail has been given about this change, and what it means for the numerous GTK applications that currently form the core of the Unity desktop. Will the default applications all be Qt-based, perhaps requiring the installation of a number of KDE libraries? Will GTK applications still be supported?

Overall, I think this is an exciting development, though the timeline seems pretty ambitious. I've always thought Qt was superior to GTK, and has a far more mature collection of development tools available for it.  Browsing the preliminary developer's documentation for Unity Next, it's evident that the availability of a powerful, ready-made, IDE has also had a significant influence on Canonical's choosing the Qt framework.

The official IDE, it appears, for Unity Next will be Qt Creator. What's interesting about this is that Qt creator is designed primarily for coding in C++. This suggests that this will become the primary app development language for Ubuntu. Previously, and quite recently, Canonical had indicated that Python would be the language of choice for app development in Ubuntu. However, while there are two very good Python Qt binding APIs available (PyQt and PySide), Qt Creator only directly supports C++. So does this signal another major switch?

Qt Creator also supports application development with QML, which was the basis for the now defunct Unity 2D desktop. My guess is that Canonical's previous experience with QML has had a lot to do with their decision to make the switch. According to the Unity Next specification page, the new UI "was developed largely" using QML.

Of course, there are many other tools available for Qt development. Qt Designer provides a drag-and-drop interface for creating the UI, but doesn't include support for code generation or editing, and therefore is not a true IDE. Nokia also provides a Qt plugin for Eclipse IDE, that functions much like Qt Creator, though I believe it also only supports coding in C++. However, Qt Designer can be used to create the UI, and then the actually coding can be done separately in Python, or any language with Qt bindings.

 Still the question remains: Has Canonical abandoned it's relatively recent plan to use Python as it's primary app development language? Also, how well will Python, or other languages, be supported on Ubuntu's various desktop and mobile platforms?

It hasn't been unusual, in recent years, for Canonical to announce significant decisions regarding the future of Ubuntu, only to change course soon after. The official sanction of Python, and the plan to adopt the Wayland display server are two well-known examples. The latter has now been discarded, in favor of Canonical's in-house display server, Mir.

This, of course, can be unsettling for potential users and developers alike. Understandably, there may be quite a bit of hesitation to commit to something, only to have it pulled out from under you soon after. The question remains: What will become of the applications that have already been created using the current development defaults, Python and GTK? Obviously, they will still work fine in other Linux desktop environments, but what about Ubuntu? How will Canonical discriminate between apps for mobile and apps for desktop?

 All that's been said, so far, is that Qt/QML will replace the Nux toolkit, currently used for Unity's 3D desktop components. Built-in support for OpenGL in Qt5 has made using Nux unnecessary. This means that Ubuntu can use a single unified toolkit for both the Unity interface and user applications. Supposedly, then, we will begin to see Qt5 implemented in Ubuntu, sometime during the next year, preceding the release of 14.04 LTS.

This seems to signal the demise of Compiz Fusion on Ubuntu, which I'm not sad to see go. While it's added a lot of fun factor to the GTK-based Linux desktop, I've always found it to be a resource hungry, unstable, piece of software. Unfortunately, however, a lot of Unity's configurability will probably go with it. A pattern that has become prevalent on the Linux desktop over the last couple of years.

I stated in a previous post, from about two years ago, that I thought Ubuntu ought to move to Qt, and more than anything needed better development tools. So, as you might imagine, I'm glad to see things finally taking shape in that direction.

However, at the same time I'm hesitant to commit to something that's still so much in flux. Minus the time invested in learning and configuring the system, 12.04 LTS is a pretty safe choice, but I have little interest in developing Ubuntu apps until things settle down, and the long-term roadmap becomes clearer.

Currently, I'm running Fedora 18 on my work laptop, and have been quite happy with it. Since I develop software for the RHEL 6 platform, Fedora seemed a practical choice. I have Ubuntu 12.04 installed on my personal laptop, though I don't use it much these days.

I'm excited to see things take shape, though it will be interesting to see how long it takes to really stabilize. It will be particularly interesting, as 14.04 will be both a revolutionary change, and an LTS (long-term support) release for Ubuntu. The desktop has also gained significant ground with computer vendors, with high-end laptops currently being offered by Dell and System 76.

Canonical has announced its intention to make available its own SDK, and has already released a preview. The goal of making apps usable on all Ubuntu platforms raises the question: what will happen to the apps that aren't compliant with this goal? How will current popular Linux applications, not developed with Ubuntu SDK, function in Ubuntu Next?

While the future of Ubuntu promises some exciting changes, there's still a lot of mystery in the details; and those details could lead to some major headaches for users. Regardless, I'm glad to see Linux personal computing moving forward with such innovative developments. A truly open mobile platform, that can double as a desktop OS, sounds pretty awesome. Standard support for native language coding is also sure to attract serious coders.