Ubuntu and QML

Last week I delivered a keynote at the Qt Developer Days 2011 event in San Francisco. I have not seen a video of the keynote online yet, but I am assured it should be online soon. Rick Spencer gave a keynote at the Munich event shortly before UDS in October.

Over the last year or so the relationship between Ubuntu and Qt has growing closer. As many of you will recall, we announced that for Ubuntu 11.10 we were going to make Qt a first-class citizen in Ubuntu. This would mean that you could install Qt applications on a standard Ubuntu system, and those applications would integrate neatly into Ubuntu. There was also a goal to ensure the Qt development tools (e.g. Qt Creator) are fully supported and ready to to roll in Ubuntu 11.10. Those goals were successfully accomplished.

Qt Creator is an IDE for building Qt and QML apps.

My presentation last week summarized the progress being made in Ubuntu make it a strong platform for app developers (e.g. refinements to the Ubuntu Software Center, developer.ubuntu.com, the MyApps process etc), and summarizing much of the work to integrate Qt neatly into the platform. The presentation seemed to be well received with a lot of excitement about Ubuntu afterwards.

Aside from delivering the keynote, I was also interested in using the event to learn more about Qt and specifically QML. We are in a really interesting position with Ubuntu in that we want to deliver a strong application development platform, and a platform driven by choice, but also a platform that allows both professional and hobbyist developers to deliver their apps.

If you want to deliver native apps in Ubuntu today, most people will either write their apps using GTK or Qt. For GTK, those apps can be written in C, Python, C# and various other languages. For Qt you can write apps in either C++ or Python (although the complete Python bindings are not 100% free). These two options provide a good set of development options for our developers.

In terms of facilities I think it is fair to say that Qt provides a more comprehensive solution. GTK, while popular (I myself, horrendous programmer that I am, have written some GTK apps in Python), brings together the core pieces you need for an app, but lacks some of the more advanced functionality that is in Qt. The traditional challenge with Qt though was that you needed to know C++ to use it, and even though Qt provides many convenience classes, C++ can be a bit much for amateur and hobbyist programmers. I think it is important that we provide a great solution for both professional and hobbyist programmers, and everyone in-between.

What has been exciting to me however is QML; a new technology that is part of Qt that provides a higher-level means of producing user interfaces. QML was not new to many Ubuntu people; Ryan Paul did an excellent presentation a year ago at UDS in Orlando, we had a great presentation on QML at UDS in Budapest, and Qt Creator and it’s QML and it’s QML designer have been available in Ubuntu for quite some time.

The integrated designer in Qt Creator.

What I was unclear on, and it seems I was not alone, is where the lines between QML and traditional Qt start and end. I knew that the philosophy in the Qt project is that you would write big and serious apps in Qt and smaller and more casual apps in QML. While these lines seemed fairly blurry, what blurred it more was that there is a strong focus on making QML more and more flexible for the up-coming Qt 5 (expected in 2012).

I went to the Qt Developer Days conference with a simple question: could someone write Angry Birds in QML. In other words, can you write a fun, vibrant, visually attractive game in the high-level, managed environment that is QML. If so, this could dramatically lower the bar for developers to write fun and interesting apps and deliver them not just on Ubuntu, but on other platforms too.

I am still very much learning about what QML can and can’t do, but from what I saw at the event and some recent research online, QML very much does provide a great solution for writing attractive, capable interfaces, games, and other applications. As an example, I was chatting to Lars Knoll, Qt Chief Architect, and he showed me an example of a game written entirely in QML, Incredible Circus, and running on his Nokia N9 phone:

He also pointed out many of the other applications on the N9 that are written entirely in QML. It turns out there there are many, many, many, many, many, many games on YouTube, even a Angry Birds clone, all written in QML.

My previous assumption about QML was that it was only really useful for creating UIs; it seems that it is also flexible for much of the logic you would need in games and other applications too.

While I have not played with QML all that much, I am excited by it’s potential, and the roadmap outlined by Lars at the Qt Dev Days offers a bright future. This is not only a bright future for Qt, but also a bright future for developers who want to deliver apps on Ubuntu thanks to the integration work done in 11.10.

It’s awesome to know about Ubuntu’s participation in promoting a mature SDK like Qt.
And while, I personally am a BIG fan of the Qt SDK , but don’t you think, as a Gtk developer, that it’s about time we have something similar to the Qt SDK where noobs can start developing on a mature , friendly and easy-to-learn environment ?

http://profiles.google.com/daengbo Daniel Bo

“Hey Jono, I’m a a new developer and would like to get started on writing apps for Ubuntu. What should I do?”

“If you want to deliver native apps in Ubuntu today, most people will either write their apps using GTK or Qt. For GTK, those apps can be written in C, Python, C# and various other languages. For Qt you can write apps in either C++ or Python (although the complete Python bindings are not 100% free) (or QT Quick). These two options provide a good set of development options for our developers.”

“Umm, OK, I guess I’ll stick with my old platform.”

Get a recommended toolkit, language, and IDE, quick.

Raja Varma

I was also a bit skeptical about QML’s ability in the beginning and thought it was going to kill Qt C++. But after trying an application using QML I’ve been so impressed with it.

Note:
It doesn’t matter whether QML can do everything or not, but do everything in QML, and use Qt where it can’t be used.

https://launchpad.net/~brunogirin Bruno Girin

I’ve dabbled in QML an it’s a really good app development platform. Now all we need are quickly templates for Qt and QML apps

http://twitter.com/andreagrandi Andrea Grandi

Great post Jono! I hope we’ll have more Qt/QML apps in Ubuntu, soon!

http://twitter.com/thp4 thp4

With “although the complete Python bindings are not 100% free” you mean PyQt and the missing binding generator tooling? If so, you are aware of PySide, which is completely LGPL’d (including the tooling required to generate bindings)? PySide has also very good support for QML (mostly because it is/was aimed at MeeGo Harmattan), and I’m using it in gPodder 3 for the mobile/touch UI without problems. There is a PySide PPA if you want to try the latest versions, it would be cool if PySide would be officially supported by Ubuntu as a 100% free alternative to PyQt.

http://gedmin.as/ Marius Gedminas

Qt SDK 1.1.4 does not work on Ubuntu 11.10 — the installer eats up half the RAM, and forces Compiz to eat the other half somehow (by creating huge pixmaps?).

Any comments? Do Canonical people collaborate with Nokia (or whoever owns Qt now) people on issues like this?

Nokia seems to know about the issue: “Do note that the current version of the Qt SDK does not support Ubuntu Oneiric Ocelot.” — http://www.developer.nokia.com/Community/Blogs/blog/n9-developer/2011/11/08/harmattan-target-for-qt-sdk-updated

Anonymous

I am aware of PySide, but I was under the impression PySide was not particularly complete, and funding for the project has ran out.

Anonymous

Well, much of this work is about doing exactly that. We are identifying platforms that we want to recommend for Ubuntu development and feature on developer.ubuntu.com.

Anonymous

There are definitely some integration issues; as an example, I am finding Qt Creator crashing quite a bit in Precise. Canonical are definitely collaborating with Nokia and there is a commitment to ensure Qt operates smoothly in 12.04.

Anonymous

Nice! Thanks for the link!

http://blog.rburchell.com Robin Burchell

It’s pretty complete as far as I know. It had rough edges back in the (much earlier) times of its existence, but it’s improved a lot since.

Regarding funding – sure, Nokia may cease to bankroll the project, but I’m not sure why you’d see that as a problem. It’s open source, after all – so anyone can pitch in, and I’m sure there’s enough interest in python as an easy development platform to ensure it has something of a future.

http://2buntu.com Roland Taylor

Sweet.

https://launchpad.net/~andrewsomething andrewsomething

Right now the story is really confusing. The current “opinionated choice” suggested on developer.ubuntu.com is Quickly w/ PyGTK, but that’s a dead end with everything moving to PyGObject and GTK+3. Witness the confusion of a developer with a Mac background looking at what that site offers:

I hope the integration of QT and UBUNTU comes soon. My keyboard based application runs OK on all Linux systems but UBUNTU.

Gary Greene

The KDE project has been also producing Ruby and Perl bindings for Qt 4 for a while now, so it isn’t really limited to only Python or C++. Add to that the QtScript engine that allows expanding your app using ECMAScript.

Srikanth

The intention of QML is to improve your productivity in creating UI for your apps, you should use it to appreciate it. It do not demand you to subclass a button to create a glassy look round cornered animated button. The logic is supposed to be written in C++, and that is how QtQuick was designed.

One can develop serious apps with QML, unfortunately I am not finding a point why you should not. PS, we betted on QML to develop enterprise mobile apps and we are not dissappointed.

Lucas Betschart

As a real developer you don’t want to learn a new language/toolkit just for a (small) plattform like ubuntu.
So its great to see that you can use your existing know-how and don’t have to learn everything from begin just for Ubuntu.
And as a new developer you always have the “problem” of choice. On Linux you have more choice by default, thats why we love it

http://twitter.com/effiejayx Efrain J. Valles P.

This is one of the things that has made me love ubuntu even more. Bringing along technologies tht otherwise would be isolated.

http://twitter.com/takluyver Thomas Kluyver

Also, IIRC, the group Nokia paid to write PySide (Openbossa), said they were still interested in supporting it, even after Nokia pulled funding. Companies like Enthought, who’re already using it, might support it as well.

PySide had a point release less than a week ago. So I wouldn’t count it as dead just yet.

http://twitter.com/takluyver Thomas Kluyver

Also, IIRC, the group Nokia paid to write PySide (Openbossa), said they were still interested in supporting it, even after Nokia pulled funding. Companies like Enthought, who’re already using it, might support it as well.

PySide had a point release less than a week ago. So I wouldn’t count it as dead just yet.

http://twitter.com/toxicbits toxicbits

What a creepy finger

Anonymous

That was something that has been discussed in the past. Qt Creator has a great environment for development, but it will need some integration points when it comes to Bazaar (I think it has a bzr plugin already), packaging, and release to a PPA.

Anonymous

Do you have some examples of the enterprise apps you wrote in QML?

http://www.facebook.com/NielsMayer Niels Mayer

QML isn’t just for games, or just for UI’s. I was able to go from concept to working prototype for http://code.google.com/p/voicetogoog/ in a matter of weeks — far more quickly than in any other framework. And it was trivial to have the same application running happily on my Fedora Desktop, MeeGo Netbook, MeeGo tablet. and N950 Harmattan handset ( http://store.ovi.com/content/195998 ).

Although many examples don’t properly use or explain the declarative nature of QML — that is one of it’s most powerful features that can can make complex applications tractable, understandable and extensible.

Lars Knoll

Unfortunately what I told Jono about Incredible Circus wasn’t fully correct, and I’m sorry for giving out some wrong info.

The game is not 100% QML based (as I found out yesterday). This is mainly due to the fact that the engine was written before QML was released.

However the developers told me that there is work ongoing to port it over to be fully based on QML2 (which is probably why I had some wrong info in my head), and hopefully we’ll see this QML2 based version being released not long after Qt 5.0 is out.

Lars

http://twitter.com/andreagrandi Andrea Grandi

as I already explained in a tweet few days ago, to “fix” this problem you have to start the installer with “-style cleanlooks”: https://twitter.com/#!/andreagrandi/status/138818935830233088

this will fix the problem until they (Nokia or Ubuntu?!) don’t fix this bug.

http://profiles.google.com/daengbo Daniel Bo

Having a “recommended” language and IDE combo with great tutorials doesn’t hurt anyone’s choice, and it makes moving to a new platform easy. I don’t think many “real developers” actually care about learning a new platform/toolkit. iPhone devs sure didn’t have a problem. Neither did Android devs. A new platform like Ubuntu already means new core libraries. There are no really good and up-to-date tutorials for hooking any language into Ubuntu’s core system. That needs to change. Start with picking one language, toolkit, and IDE, then get a good set of docs for that. Once you’re past that point, we can consider writing for multiple languages.

I’m currently of the opinion that the easiest way for Canonical to achieve this goal would be to settle on Unity 2D as the standard interface, jettison Unity 3D, and make the rational choice from there to use QT as the standard toolkit throughout the desktop. Tutorials for QML and QT Quick are already abundant, and the QT docs are excellent. All that’s missing is the Ubuntu-specific portion. Canonical adopts QT (it’s still in limbo, right?), and the distro is unique, full-featured, and almost completely under the control of Ubuntu moving forward, which isn’t the case now.

Jussi

Is this still true? Is Qt stil a first class citizen on ubuntu? (after move to Digia and discontinuance of Kubuntu development)