ubuntu-phone team mailing list archive
-
ubuntu-phone team
-
Mailing list archive
-
Message #03391
Re: Is there going to be a standard QML UI toolkit?
Hi
On Monday 29 July 2013 15:53:52 Andreas Poulsen wrote:
> I just wondered, if there is any plan to have a more general QML UI
> toolkit. For now, there is Ubuntu.Components, Sailfish OS has some
> components, and QtQuick is going to have some QtQuick.components. Could
> you guys talk together about some standard components? It would be much
> more easy, to develop one app for 2 or 3 platforms, than creating it for
> 3 platforms using the same technology, but different toolkits. Just a
> wish from an app developer :)
Yes, this is really one of the bad things of the current state with QML in
general.
There are talks in progress to align APIs as close as possible. However, I
think it won't be possible (at least not in the foreseeable future) to have
the same components everywhere. The reason is that different platform look and
behave differently. Even if most of the components could probably aligned,
there will always be differences for some of them. For example if a platform
doesn't have some UI pattern or a platform invents a new one. One example is
the hiding Toolbar on Ubuntu. MeeGo's toolbar didn't do that so there is the
need of a difference in the API.
Also a different look of the same UI patterns introduces problems here. For
example if one platform uses big round buttons with spaces in between while
another one uses small square buttons without a space. That would allow you to
place a different amount of items into one row. While the API might be
compatible, your application would look quite bad one one of the platforms.
The original idea for QML was to write the common stuff in Qt/C++ and then
create a very thin UI layer with QML on top of it. That thin UI layer is easy
and fast to write (just puttin some Buttons and Images into a layout and hook
functionality up to the C++ business logic which is really cross platform).
This works quite well for me having a bunch of apps running on Maemo, MeeGo,
Symbian, KDE and Ubuntu Touch.
Of course, if you write an app only in QML and smash your javaScript somewhere
between the painting code, your app's portability will go towards 0. You can
of course stick to JavaScript for the platform independent code too, but make
sure to have JavaScript in separate files, and with a clean API, never
accessing properties/elements from the QML code from within JavaScript. Then I
guess you can create something somewhat portable without C++ too.
Br,
Michael
Follow ups
References