Thursday, August 11, 2011

First shot of my developments with Qt Declarative

Hi all !

During the last weeks, I tried to develop apps for my N950 using QML. But I can't please myself with the QML default behavior, so I started my own Components set, based on QtDeclarative, but with the aim of using them only from C++, as we use to do with good old QWidgets.
I've named it MWTk, for Mobile Widgets Tool Kit.

I first created a global generic schema of the organization of a mobile app window, and then isolated the different Components that  can be made to ease the developer's life.
Here is the schema :

And after that, I've begun to build the C++ classes for each Container components (Panels, ToolBar, Workspace, Window...) and did some Content Components too (Label, Text Edit, Slider...).

The Toolkit was from the start thinked to be fully compatible with auto-orientation, and to do the theming and the layouting (with smart positioning for an optimal view size in each mode) without the need for the developer to have some graphical skills of any sort.

So here is a screenshot of my little test app (does nothing, its actually a simple sample, kinda empty shell) :











Some more info :
- The final ToolKit will be fully documented using Doxygen, in order to generate an HTML documentation.
- The source is full Qt/C++, no external lib required.
- The project is regulary pushed to a gitorious repository : https://gitorious.org/meego-community-mobile-ux-ng/libmwtk-ng

I have included some special features
- a JSON parser, to parse a JSON string as nested QVariantMap (like in QJson)
- a Smart Text Color (based on parent lightness)
- and very soon, there will be the all-powerfull Smart Layout, a mix between QML anchors and the former QWidget Layout, allowing you to specify a natural flow for a group of Components, using a single method like Attach(item1, gravity_point, item2, attach_point), e.g. to attach a label centered under an icon you will do attach(textitem, MWTk::TopCenter, iconitem MWTk::BottomCenter)... Plus, margins and spacing are automatically determined, as well as auto sizing to fit content to minimum height, and strech width to fill the parent.


I hope this pleases your eyes, and I making my possible to finish the ToolKit ASAP to allow you (and me too) to start developping apps with it.

No comments:

Post a Comment