Developer Library latest update

This Developer Library and API reference update includes documentation for PR 1.2 features and documentation enhancements for existing features:

As always, your feedback about the Developer Library is very welcome!

 

 

Developer Library latest update

This Developer Library and API reference update includes documentation for PR 1.2 features and documentation enhancements for existing features:

As always, your feedback about the Developer Library is very welcome!

 

 

UX documentation up to date

The Nokia N9 UX Guidelines site is now up to date, so go have a look. We’ve also improved the organisation of the site to serve UI designers and developers better. Improved linking between the UX site and the developer documentation means that it’s easier to match what you want to do with how to do it.

However, the Chinese-language UX materials
have not been updated at this point. If you are using them, we’d like
to hear from you! Do you think it’s useful having some material
available in Chinese? Should there be more? Less? Different materials?

Some findings on application orientation in MeeGo 1.2 Harmattan

Few days ago I had a chance to play for a wile with my Nokia N950. I’ve tried to port some Qt application from Symbian to Harmattan and unfortunately faced with lack of support of QWidget and QGraphicsView based applications in that platform. Some of my findings are below:

  1. QWidget-based objects don’t have any native style support and looks exactly as in Windows. Which is obviously awful
  2. There is no working API to set application window orientation. Moreover, the default orientation is landscape! Some interesting details are here.
  3. In case you are using QML-based UI you should rewrite it and use Window\PageStack\Page classes to be able to change your app orientation. Or probably rotation trick will work for it, but i didn’t check.

That seems a bit unfair for me as there are Qt 4.7.x libs preinstalled and QWidgets\QGraphicsView are still mainstream ways to develop UI for it. That might cause a lot of problems during the porting of Symbian\Maemo5 applications to Harmattan.

In my case the app i tried to port contains QGraphicsView with some pixmap elements in it and some QPushButtons with images over them (without text). So i’m luckely avoid QWidget-style problem.

Its launched on N950 without any changes in sources and looks great (of course due to devices screensize the images were smaller). But it had landscape orientation. And i spent a lot of time on fixing such a simple thing. Finally, i have managed to rotate UI using the following:

  1. Call of QGraphicsView::rotate(270) to automatically rotate all items in it.
  2. Change x and y in event handlers code to fix some animation framework staff.
  3. Just move QWidget-based buttons position and rotate all images in it.

And one more step (that’s actually the real reason of that post and the only thing I have to share). The system itself still treats your application window as landscape oriented. That mean, for example, that if the "Top slide closes the application" setting is switched on in your device it will not work correctly for your app window. Actually, it will but with wrong sliding direction (right side is top for landscape oriented windows). To fix this behavior and let system know that your window is portrait oriented you should call following function for your top-level widget:

 
Normal
0
false
false
false
RU
X-NONE
X-NONE

Normal
0
false
false
false
RU
X-NONE
X-NONE

#ifdef Q_OS_UNIX

#include <QX11Info>

#include <X11/Xatom.h>

#include <X11/Xlib.h>

#endif

 

enum MyOrientation

{

    Landscape = 0,

    Portrait = 270,

    LandscapeInverted = 180,

    PortraitInverted = 90

};

 

static void writeX11OrientationAngleProperty(QWidget* widget, MyOrientation orientation= Portrait)

{

#ifdef Q_WS_X11

    if (widget)

    {

    WId
id = widget->winId();

    Display *display = QX11Info::display();

    if (!display) return;

    Atom
orientationAngleAtom = XInternAtom(display, "_MEEGOTOUCH_ORIENTATION_ANGLE", False);

    XChangeProperty(display, id, orientationAngleAtom, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&orientation, 1);

    }

#endif

}

 

 int main(int argc, char *argv[]) {

    QApplication a(argc, argv);

    Form f;

    writeX11OrientationAngleProperty(&f);

    f.showFullScreen();

 

    return a.exec();

}

 

 


The code was copy-pasted and adopted from some MeeGo sources.

Unfortunately it just tells the system that your window orientation is changed, so OS can manage it accordingly. But it doesn’t change orientation of content inside window so it doesn’t affect window rendering.

 

Porting MeeGo 1.2 Harmattan Qt Quick Components


In my previous blog I had introduction to MeeGo 1.2 Harmattan Qt Quick components, in this blog I  wrote about porting components to other platforms than MeeGo 1.2 Harmattan and in next one about porting applications to different Qt Quick Components like MeeGo-Ux, Symbian or desktop.

Nokia N9 device will be largest volume MeeGo device in near future and most interesting platform for MeeGo application developers.  Portability of  Harmattan components is interesting issue for many reasons. N950 developer devices are produced only limited quantity and N900 provides excellent developer platform that is more easily available. Many MeeGo developers would like to see their application to run other MeeGo devices and would like distribute their application for all of them. Harmattan components are licensed as BSD license, so they are free to distribute any platform.

MeeGo 1.2 Qt Quick components are portable code but there is some issues need to taken care when porting them.First one is that components use Qt Quick 1.1 and most platforms like Ubuntu Natty or MeeGo 1.2 still have Qt Quick 1.0. I have made patch set allowing components to run in Qt Quick 1.0. This is problem is just temporary, and vanish  soon when MeeGo and Ubuntu upgrade  up to date Qt version in next release.  

Second issue is theming. MeeGo 1.2 Harmattan SDK comes with Nokia MeeGo 1.2 Harmattan product theme that is same theme used in production device, N9. This theme is Nokia proprietary. It may be used in software development but it can’t be redistributed. When you make applications for N9, this is no problem because theme is factory installed in N9. If you would like distribute your applications to other MeeGo or even non MeeGo devices, you need to use theme that allows redistribution.  Standard MeeGo 1.2 uses MeeGoTouch theming that is based on .svg files having multiple graphics elements in one file. Qt Quick uses .png BorderImages. To use components, I have exported graphics elements as .png files and made separate add on package. Now developers have two choices, if they would like just develop for N9, it is recommend to use Nokia “blanco” theme, if intention is to distribute application to other platforms, you should use open theme based on MeeGoTouch “base” theme or other compatible theme.

Third issue is different UX. The UX between MeeGo 1.2 handset, MeeGo 1.2 tablet and MeeGo 1.2  Harmattan. There is a big difference to end user, MeeGo 1.2 Harmattan has magnificent swipe UI where task switching is done by swipe gesture. MeeGo 1.2 handset uses traditional way to have close button in application toolbar and MeeGo 1.2 Tablet uses hardware home key. The great advantage of Harmattan Swipe gesture is that no valuable screen space is wasted for home button and toolbar and there is no device front surface wasted for home button and larger amount of device front surface can be used for display and actual application. My experience of MeeGo tablet is still based on keeping one tablet in my hand 5 minutes. For application code difference is small. In MeeGo 1.2 handset application should initiate itself task switching but minimizing it’s window. In MeeGo 1.2 Harmattan and MeeGo 1.2 tablet, task switching activity is initiated by external process as result of swipe gesture or pressing home button. If we compare to typical desktop applications, application switching, minimizing and closing window is initiated by external window manager application. Close and minimize buttons are in desktop in window frame that is owned by window manager, not by application. Maemo Hildon used same method, tittle bar was owned by system process. In MeeGo, all screen is owned by application and if there are home and close buttons, application should respond to them and initiate action. Other small difference is that in MeeGo 1.2 Handset and MeeGo tablet, toolbar is at top of the window when in Harmattan it is at bottom. At summary differences:

  • MeeGo 1.2 Harmattan: Toolbar at bottom, no close or home buttons needed
  • MeeGo 1.2 Handset:Toolbar at top, Home and Close buttons needed
  • MeeGo 1.2 tablet:Toolbar at top, no Home or Close buttons needed

What that means in practice to application developer ?

You can use Harmattan components to develop applications to all MeeGo devices. With small effort you could adapt your application UI to MeeGo 1.2 handset or MeeGo 1.2 Tablet. At minimum, you need only to add Close and Home buttons to MeeGo 1.2 Handset applications. Your applications would look like more consistent to other system applications when you move toolbar to top of the screen and to redistribute your code for non N9 environment you should use free “base” style.

ToolBar location

In Harmattan UX, the toolbar is located on bottom of screen, in MeeGo handset or MeeGo Tablet, Toolbar is located on top of screen. By default toolbar location is hardwired to bottom in Harmattan components PageStack.qml , I made small experimental patch, adding property toolBarOnTop that defaults as false. Setting this property true, you will have toolbar on familiar place in MeeGo 1.2 handset or tablet. Remember, that property, toolbarOnTop is not standard, do not try use it in Harmattan.
 

Home and Close buttons

In Qml To have Home and close buttons in your toolbar, you should add them to toolBarLayout. In front page you should have home button in left corner and close button in right corner. In other pages there should be back button in right corner.  Qml does not directly support minimize or close, you need to have hooks in your C++ code to server slots. Add following lines to your main QdeclarativeView

 


   QDeclarativeView window(QUrl("qrc:/main.qml"));
    window.rootContext()->setContextProperty("mainWindow",window.window());
    QObject::connect((QObject*)window.engine(), SIGNAL(quit()), &app, SLOT(quit()));  

Your Main page  .qml file could look something like this. In harmattan, you don’t need toolbar in main page at all unless you have menus or some other need for it and you can omit tools: from mainpageComponent. Commontools is commont toolbar definition that is used in all subpages.


PageStackWindow {
    id: rootWindow
    initialPage: mainpageComponent
    toolBarOnTop:true // Experimental non standard property

    ToolBarLayout {
       id: commonTools
       visible: false
       ToolItem { iconId: "icon-m-toolbar-home"; onClicked: mainWindow.showMinimized();}
             ToolIcon { iconId: "toolbar-back"; onClicked: pageStack.pop(); }
        }

 Component {
  id: mainpageComponent
  Page {
    id:mainPage
    tools:
     ToolBarLayout {
      ToolItem { iconId: "icon-m-toolbar-home"; onClicked: mainWindow.showMinimized();}
      ToolItem { iconId: "icon-m-toolbar-close"; onClicked: Qt.quit(); }
     }


Equivalent version for Harmattan is


PageStackWindow {
    id: rootWindow
    initialPage: mainpageComponent

    ToolBarLayout {
       id: commonTools
       visible: false
             ToolIcon { iconId: "toolbar-back"; onClicked: pageStack.pop(); }
        }

 Component {
  id: mainpageComponent
  Page {
    id:mainPage

 

Some desktop/mobile related porting issues

Most of developers develop applications in desktop first and them move to real device or emulator. Harmattan Qt components work without problems on desktop. It defaults window size as 854×480. To render window correctly in MeeGo 1.2 or Harmattan environment, window must be created as full screen with window.showFullScreen(); in desktop this is annoying of your test application window pops upp full screen 2560×1600 size with small patch of content in middle. In Harmattan components this was resolved just easy way


#ifdef __arm__
    window.showFullScreen();
#else
    window.show();
#endif

This works in Nokia devices but is not so nice for x86 based touch screen devices. Some little bit more clever way is needed. I made code so that that it just takes size of screen and it it is smaller or equal 1024×800, assume touch device and use full screen, if it is larger, render into window. I made also patch in mdeclativescreen.cpp so that it uses screen size as default size if running smaller screen than 1024×800.
Here is full main program with handling close and minimize and setting full screen in small displays.


int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    QDeclarativeView window(QUrl("qrc:/main.qml"));
    window.rootContext()->setContextProperty("mainWindow",window.window());
    QObject::connect((QObject*)window.engine(), SIGNAL(quit()), &app, SLOT(quit()));

    QRect screenGeometry=QApplication::desktop()->screenGeometry();
    if((screenGeometry.height()<800) && (screenGeometry.width()<1024))
         window.window()->showFullScreen();
    else window.window()->show();

    return app.exec();
}

Release Notes for MeeGo 1.2 Harmattan Qt Quick Components ports

The current base package is qt-components – 1.0~git20110620-7-1fn, it is available now for Ubuntu Natty and MeeGo 1.2 arm and x86 targets.  If you would like to use experimental version of MeeGo 1.2 graphics and not Nokia Harmattan product graphics you can down load extra theme graphics  , qt-components-base-icons-0.3 . If you are running in non-MeeGo environment you need also to install meegotouchtheme package. If you would like develop for N9 with product graphics, I recommend to use graphics delivered with MeeGo 1.2 Harmattan SDK (QtSDK) or Platform SDK (Scratchbox)

You can get MeeGo 1.2 Harmattan Qt Components port for Ubuntu from Forum Nokia PPA qt-components – 1.0~git20110620-7-1fn


sudo add-apt-repository ppa:forumnokia/fn-ppa


sudo apt-get update

sudo 
apt-get install qt-components qt-components-base-icons meegotouch-theme


For MeeGo 1.2 , arm and x86 components are located in: http://repo.pub.meego.com/home:/kate/DE/  .


MeeGo arm version is tested on N900 Community Edition, x86 version for tablet is mostly untested, may be just my bad luck setting environment. Qemu image just freezes after few minutes and chroot Image Xephyr died in few seconds…..

At teh moment, code is only in my personal repository but i hope that
we get them soon some more convinient repository. At the moment,
download files and install them with rpm comman.
When we get files to repository, use zypper



zypper install qt-components qt-components-base-icons

Maemo5 packages will be soon in maemo extras-devel repository.

Chanegs to original git version 

  •     Works witn Qt Quick 1.0
  •     Autodetect “base” and “blanco” themes
  •     environment M_THEME_NAME specifies used theme when multiple themes are present
  •     Use full screen size when unde 1024×800 , original was fixed 854×480
  •     toolBarOnTop property to PageStackWindow
  •     qt-components-base-icons extra icons for base theme

Symbian style Qt Components on N900

It may not be obvious to everyone, but the current shape of Symbian components on Qt Components gitorious repository is pretty good. Just for kicks, I compiled it in N900 scratchbox and took a screenshot:

Symbian components on N900

No special steps were needed to build the repository, just

git clone git://gitorious.org/qt-components/qt-components.git

cd qt-components

./configure -config symbian3 

make

make install 

And then run  examples/symbian/qmlgallery. Earlier, we packaged "meego" style components for N900, but as the public version still relies on MeeGo Touch libraries, the Symbian set of components could turn out to be a lighter solution. If there is interest, we will package a snapshot of this version as well.

Image loading fix for N900 &amp; QML

Now that Qt SDK 1.1 is finally out (in form of Tech Preview), people are rightfully hacking with QML. There is, however, a snag with QML on N900: Image elements with remote URL don’t load. So, if you are doing a QML application, remember to install "mcsp" on your device (sudo gainroot; apt-get install mcsp), and add it as a dependency on your debian package. (mcsp is short for "Maemo Community Service Pack", which is our way of delivering community hotfixes). 

The package has been added as dependency for mad-developer, so new developers are likely to not see the problem. It is still important to add the dependency to your app’s packaging metadata (debian/control), so that the program will work for end users as well.

Your debian/control will probably end up looking like this:

 

… 

Build-Depends: debhelper (>= 5), libqt4-dev

… 

Depends: ${shlibs:Depends}, ${misc:Depends}, mcsp

… 

AR-Drone with MeeGo



Main view with live feed from AR-Drone camera and telemetry

Here is a little hcking project that I am releasing just before Christmas, it is something fun to play around, something that really moves and makes also non-hackers exited. It also allows to you use own imagination to enhance this base application to be even more fun. Least to me, Christmas has been always time to build something that is fun,like all kind on flying gadgets. I still like playing with everything that flies, some ones where I can sit myself in pilot seat and someone that I can control remotely.
I decided to combine work and fun and also offer a super-cool possibility to learn MeeGo and Qt Quick with having fun, just go shop and buy AR-Drone 299$ and download code from http://mardrone.garage.maemo.org and have happy hacking.
 
After Nokia announcement focus Qt and Qt Quick and after my previous blog howto make modern mobile applications with qt quick components there has been a lot of need for some real life full show case applications how to do UI with Qml and how to use existing C++ application logic. We have also here in Nokia term “dogfooding”, we should eat own dog food that we make. In his Qt Quick / Qt Components in the case I should say that it’s the best dog food I have ever had.

Other goal for this application has been show, how easy is to make MeeGo versions of iPhone applications. Original Ar-Drone FreeFlight application was made for iPhone. Making Qt Quick UI for this application takes just day or two. Current UI still looks like engineer’s tool, because it is made by an engineer. To make it really good looking needs touch of UI designer and great graphics but no SDK can solve this problem even it is iPhone, Android or MeeGo. Integrating C++ code to Qml took less than days work.  The more detailed anatomy of this application is coming on second part, next blog entry.

There has been also criticism and rumors that Nokia would be killing Maemo and no-one should any more develop for Maemo. I would like to prove all these rumors to be wrong. The best option today is to develop with maemo5 with Qt and Qt Quick and when a MeeGo handset is released, just deploy your application for it, it is that easy.

You should remember that our Harmattan project started as called Maemo6 but after merging to Intel Moblin it became MeeGo. Maemo and Moblin already had common roots and result of this merge was not incompatible what Maemo6 was. I have compiled and run this same application without changing a single line of code in both N900 with Maemo5, our future MeeGo based device and Ubuntu Lucid in desktop. Your application will run on all platforms unless you intentionally chose some obsoleted API’s like GTK+ based Hildon. For someone that does not like EOL of some old API’s I recommend reading my previous blog entry, we just needed to renew our UI technology to be competitive and as application developers you should be happy that we can provide now best application development platform where your imagination is only limit in UI creation.

AR-Drone and application

Technologies, that I use in this AR-Drone application are: All QI Is Implemented with Qt Quick QML Language and MeeGo Qt Quick Components with addition of some my own QML and C++ components. I have integrated to the UI seamlessly some my existing Qt GraphicsView code as custom component and existing C-code, AR-Drone video codec used in iPhone and in their GTK+ demo application. All application logic is coded with Qt / C++ . Application uses real time and performance critical things like live video feed from drone camera, real time telemetry data from drone and augmentation of video with realtime HUD display.

What is then the AR-Drone ? AR-Drone is quatrocopter, Vertical Take off and Landing ( VTOL) aircraft, rotorcraft like helicopter. Quadrocopters are not so efficient for cross country flying they are very simple to construct with electric motors and due simplicity they are very crash proof and durable. With implementing artificial stabilization with software and sensors they can be made very easy to fly and handle. Typical RC-helicopter may need dozens of hours, many dozens of crashes, disappointments, lot of glue and hundreds of euros. As opposite, AR Drone, you just press fly button and it starts hover about one meter over ground and then you can start moving it.

Technically AR-Drone is much more advanced than standard RC-aircrafts. It has 32 Bit ARM processor running Linux, it is controlled over WLAN and it has bi-directional data stream transmitting back both telemetry data and live video feed from two cameras on drone. For flight control AR-Drone does have 3 axis MEMS Gyro ( angular speed sensor) and linear acceleration sensor, ultrasound for measuring altitude and bottom facing camera for position holding.

AR Stands for augmented reality and it’s manufacturer, Parrot calls it as flying video game. You can implement as example air fight between two drones by detecting others color tags from video and augmenting video image with ammunition trails or misles. I my application I did not yet try to make this kind of game but i have already augmenting layer implementing HUD ( Heads Up Diaplay) , similar than fighter planes have showing flight instruments over pilot’s vision.

This is not a sponsored add, i just bough my AR-Drone from Sunnyvale Bookstone shop with $299.

Basic structure of application

The main program is very simple, it just registers my three C++ classes to Qml and then creates QdeclatariveView with my main Qml file, ardrone.qml. For easier application packing, it uses Qt resources to keep qml files, so no extra files is needed to install with application. The ardrone.qml then imports my “drone” classes with import Drone 1.0 . 

Main class is called by DroneControl, it does not have any visible representation to Qml, it’s purpose is to implement actual application logic and expose it’s interface to QML. DroneControl creates instance of  DroneThread that handles real time control and telemetry connection with drone. DroneControl class also implements interface to QSettings for application settings storage.
DroneControl also implements command protocol and telemetry data parsing. They are implemented from scratch with Qt, i had option to use also AR-Drone SDK VP_LIB library functions but they had so heavy dependencies that i did not like and the command protocol was so simple that i decided that it is easier just do own implementation with Qt/C++

As addition to main Logic, I created class DroneVideo derived from QGraphicsWidget . For Qt C++ view it is just like any other QGraphicsWidget derived class that can be used to Qt QGraphicsView applications. It did not need any modifications to be used as component from QML. Standard QGraphicsWidget properties like position, size etc are already automatically exposed to QML. That means that you can use your QGraphicsWidget or QGraphicsItem derived classes in many cases without any modifications from QML. The DroneVideo implements video streaming functionality via separate VideoThread. It was easiest way to implement this application and re-use codec from AR-Drone SDK. In future more elegant solution would be to implement codec as Gstreamer module. The DroneVideo is not yet optimized at all, in future I should also consider implementing YUV-RGB conversion and scaling with GPU OpenGL-ES2 and shader code. Performance currently in N900 is fair but even this implementation gives relativelly good performance in MeeGo device.

Third C++ class I used, was also re-use from my previous Qt QGraphicsView based application implementing HUD, Heads Up display, artificial horizon with declination and inclination indicators.  It was mostly as it is, but just non-standard properties exposed to QML with Q_PROPERTY declaration. HUD is drawn as overlay over video picture. If yoy would like to add some augmented reality stuff like gunfire, missles etc, just replace HUD drawing code with it. You could also use Qt OpenGL-ES2 if you need more compled Augmented reality.

The actual UI is implemented with Qt Quick and Qt Quick MeeGo Components. The main QML UI file is under 200 lines of code, specifying layout of main screen of application and binding UI element properties to C++ class variables. Main page is mostly custom UI in full screen mode, more like games are but it uses MeeGo Qt Components framework and some items like Button and Text there. Joysticks are implemented as my own QML components. If you need some custom UI component, in  many cases you can do it with 10..50 lines of QML. The settings page is implemented as separate page less than 200 lines. For easy application deployment, all qml files are included to executable code as resources, so no extra directory is needed for them.

Building application

To build application, you need to have Qt 4.7 and Qt Quick components installed.  You can read from  howto make modern mobile applications with qt quick components how to install them for both Ubuntu and Maemo5 Scratchbox development environment. You don’t need to use Qt Creator but if you would like to use it, you can read it from qt creator and scratchbox .

My application source code you can get from http://mardrone.garage.maemo.org with git.

git clone https://vcs.maemo.org/git/mardrone

To addition, you need AR-Drone SDK that contains video codec library for AR-Drone from
https://projects.ardrone.org/  

You need to apply patch ARDroneLib.patch from mardrone to compile AR-Drone libraries under scratchbox for Maemo/MeeGo target and to expose couple of previously static functions to application. The AR-Drone SDK were unaware that you could compile for ARM target under Linux that looks a like “native” ARM that does not look as embedded linux.

If you would like to build test version of this application for both desktop and Maemo/MeeGo target
and do it automatically from Qt Creator from same source directory, extract your AR-Drone SDK for both your Ubuntu host and scratchbox under your home directory. They are in real life different directories and so you can have x86 in host and ARM under your scratchbox. To build, execute under your host and scratchbox both

cd ARDrone_SDK_1_5_Version_20101004/ARDroneLib/Soft/Build/
make

To build actual application, you can either just open ardrone1.pro file with your Qt Creator and
press run, it should compile it with your host Qt4.7 . Compiling under scratchbox from Qt creator, please refer previous blog. Or you can just compile it from command line

qmake
make

If you would like to make installable debian package:

fakeroot dpkg-buildpackage -b

And you should have ready made application to run. If you have installed it from debian package, you will have ready icon. If you would like to run it fron command line, In  current pre-alpha N900 Qt Quick components MeeGoTouch style libraries there is bug that you should start your application with

mardrone -graphicsystem native 

That is slower than opengl but with opengl render you got all components as red background.

Using using application with AR-Drone


WARNING this application is at the moment early alpha level, version 0.1. It is intended to be used as technology demo and suitable only hackers that can read, understand and fix the code. There are still unknown bugs and unimplemented features like acceleration sensor, joystick, better UI style etc. Don’t try this unless you know what you are doing.



When you have your drone, i recommend to first test flight in place where you have free space around but not in windy weather. Best place is big empty room like garage etc. The drone should auto-hover after takeoff and it if crash resistant, so it should not get easily broken if you collide walls etc but try avoid it.

First step, you should connect your device to AR-Drone Ad-Hoc WiFi network. After powering up your drone., you should see network named ardrone_xxxxxx, connect to that one. It should assign IP 192.168.1.2 to your device and drone will be 192.168.1.1 .

The next step is to start mardrone application. It takes little moment and you should see application main window. If the connection to drone is successful, you should see video feed from drone camera. If you see gray background with X, over it, there is no video feed and no connection to drone.

By default you should also see two lines of green text over joysticks. They are debug status from drone. If there is something wrong in your drone, you should see message there. As example, if you carry it by hand, it may have too high angle and you get message there. You can reset status by pressing emergency twice.

To fly the drone, press “fly” button on bottom of the screen. The drone should take off and hover about one meter over ground. It should not move to any direction without you controlling it with joysticks in left and right side of screen. Try first right joystick, it moves drone up, down and turn around. When you are familiar controlling, try right one, it makes drone to fly forward, backward, left and right. Be careful, with full deflection drone flies fast and may collide something.

 

Happy Hacking

How to make modern Mobile applications with Qt Quick components

Qt Creator with Components

What Ui toolkit I should use for mobile
application development has been a top issue since Maemo5/Fremantle SDK
alpha release. There were two choices available, GTK+/Hindon and Qt.
The amount of choices has been increased since then and caused a lot
of confusion among developers.

Many developers would like to continue
to use their old familiar UI toolkit, GTK+/Hildon, QWidgets or
Symbian Avkon but there is many reasons reconsider your choice and
look at a new toolkit Qt Quick and Qt Quick Components.

To find reasons, we should look 30
years back into history. The modern desktop Graphical User Interface story
begins from Xerox Palo Alto Research Center, PARC. Most of basic
inventions like mouse, desktop metaphor and windowing system with
overlapping windows were made there. Modern Desktop GUI matured to
it’s current state with first Apple Macintosh release 1984. You can
read more about the history from
http://en.wikipedia.org/wiki/History_of_the_graphical_user_interface
.

After these days, there were no major
changes in Desktop GUI paradigm, we had standard UI elements like overlapping
windows, pull down menus, scrollbars, dialogs, buttons etc all same
form that they are today. There were multiple toolkits with lot of
different APIs implementing the same elements. We had Mac and Windows
native toolkits and several toolkit variants for Linux/Unix. Qt
toolkit, first version released 0.90 was released 1995, offered
common cross platform QWidget API for GUI programming.

There was a major UI paradigm shift in
2007 when the first iPhone was released. The old desktop metaphor with
mouse interaction was abandoned and a new one introduced. Scrollbars,
overlapping windows and mouse-sized UI elements were gone and
replaced with sliding windows, scrolling from content pane and
widgets designed to be used with finger. iPhone was the first successful
touch screen device that was sold with high volumes. Before that,
there were numerous touch screen devices on the market, both pocket sized
and laptop or pad form factor but none were successful.

All these old generation touch screen
devices were still using old desktop UI paradigm and touch screen was
just a mouse replacement. In most of the cases it needed to be used with
a stylus to provide mouse-like pixel accurate pointer. The idea was good
but users just did not like it.

N900 with Maemo5, announced 2009, was
the first Nokia device with a new finger based UI paradigm. Maemo5 had
finger optimized UI components, sliding stacked windows, kinetic
scroll from content pane, all implemented top of desktop-oriented
toolkits, GTK+/Hildon and Qt/QWidgets. The new Mobile UI needed a lot of
modifications to these toolkits that did not become adopted upstreams
implementations as those were still focusing solely on the desktop. Maemo5
implementation was also based on support from tailored window manager
for window transitions and stacked windows, enhanced X11 keyboard
protocol was used for the virtual keyboard. Also, none of these
enhancements were adopted to upstream and Maemo5 toolkit extensions
run only under the Maemo5 environment

Maemo6 that later become MeeGo, was
started from a clean sheet. Enhancing legacy toolkits, GTK+/Hildon or QWidgets, were
insufficient to implement leading edge mobile user experience. The UI
toolkit should be based on QGraphicsView/QGraphicsItem rather than
old QWidgets. The new approach allowed us to take control of UI
elements, transitions and animations inside of the toolkit. Now we had a
possibility for a lot more complex animations in element level, animated
dynamic layouts etc. There were three parallel development paths
inside of Nokia, C++ based Orbit for Symbian, MeeGoTouch for MeeGo
and a totally new concept Qt Quick with QML. For the first MeeGo timeframe
MeeGoTouch was the only available toolkit and it was used for all basic
MeeGo applications.

Qt Quick was part of Qt4.7 released
October 2010. The Qt Quick can be considered revolutionary step in
UI implementation, even complex UIs were possible to implement with a
few easy lines of Qml code. Qml is also easy to learn for UI designers used
to work with web UI tools.

The basic Qt Quick contains only Qml
that could be considered as a low level UI toolkit. It supports basic low
level elements like rectangles, images, mouse areas etc but it did
not contain UI components by itself. If you are using plain QML you need
to implement UI components by yourself. That is not a problem in many
applications that are using their custom UX and UI style but it is
wasting time if you just would like to use system UX with system
style and standard UI elements. The Qt Quick Components project was
introduced to produce ready made Qml UI elements library for Qt
Quick. Current status of components project is pre-alpha for MeeGo
but it still offers basic UI elements and it evolves quickly. Qt
Quick components are also on their way for Symbian and desktop UX.

Our choices

Now we have all pieces together for UI
puzzle and we just need to put them together and make our choice. Many may still think that old toolkits
like GTK+/Hildon and QWidgets look like attractive choices. Nokia
has dropped support of GTK+/Hildon, but QWidgets you’ll find everywhere,
they run on all desktop platforms and they run on major Nokia
platforms. Porting old desktop application with QWidgets looks to most like the 
logical solution, you could use same codebase and cover Linux
desktop, Mac, Windows, Maemo5, MeeGo and Symbian.

Even if the choice looks attractive,
there are two major drawbacks. First of all, if you are porting from
desktop, you need full refactoring of your UI. Desktop metaphor is just
so different than mobile that it just don’t work. This has been
tried and it does not work for multiple reasons starting from screen
size, resolution and UI element sizes that are different. You just don’t
have room for large toolbars, forms etc. and using of tiny UI elements
with finger is impossible.

The second major issue is that mobile
enhancements to these legacy toolkits were not adopted upstream and
they are not cross platform. Even if you find QWidgets in every platform
running Qt, only Maemo5 supports variant that allows implementing
fairly good mobile user experience. In other platforms, you fall back
more or less basic desktop implementation that’s usability in mobile device is very poor. Also due
to differences between the mobile platform implementations and their
behavior, the same code may work in a very unexpected way.

QWidgets

 

 

Choice is clear, Qt Quick

 
Toolkit table

The choice is clear, if you would like make
your application success in Mobile, you should use new UI toolkits
designed to meet the mobile requirements. At the moment there are
three toolkits available, MeeGoTouch, Qt Quick with plain Qml and Qt
Quick Components.

MeeGoTouch is mature but it is not cross platform and not recommended for new
application implementation.

Qt Quick should be considered as the preferred
future way, it is a part of standard Qt4.7 and exists in all platforms
including desktop, Maemo5, MeeGo and Symbian. Qt Quick is clearly the
way that I recommend to developers. Then there is still one question
open, use just plain QML or be early adaptor of Qt Quick components ?

Qt Quick Components

The Qt Quick components project, http://qt.gitorious.org/qt-components,
is currently as pre-alpha in a rapidly evolving phase. It is developed as
MeeGo handset UX as pilot platform but Symbian and desktop UX are on
their way. Even MeeGo components are still early stage, they already
offer fairly good set of MeeGo UI elements and allow implementing
most parts needed of MeeGo handset UX. There are still some UI
elements that are not yet implemented and for the existing ones, APIs are not yet
frozen so you should be prepared to do changes to your QML code when
first released version is published.

MeeGo UX Qt Quick components are currently available ready to use
debian packages for Desktop Ubuntu Lucid and Maveric,
MeeGo/Harmattan ( .deb format) and for Maemo5/N900 as .deb format.
You can start developing applications for MeeGo today, just
by downloading these development libraries. Even if the there will be API
changes before released version, changing some lines of your QML code
is a much smaller task than completely redesigning and reimplementing your UI code once again.

How to start

Following examples are not intended to be comprehensive course or
documentation of Qt Quick components but just a source of inspiration
and also to demonstrate how low the threshold is, even with someone
without any Qt Quick Qml experience, to start coding with the Qt Quick
Components.

Easiest to start development is to install Qt4.7 and Qt Components
to your Desktop Ubuntu from Forum Nokia PPA.

sudo
add-apt-repository ppa:forumnokia/fn-ppa
sudo apt-get update
sudo
apt-get install qt-components-dev libqtm-dev libmeegotouch-dev


You can find more instructions about installing and setting up
Qt4.7 for your Qt Creator from Attila Csipa’s blog
http://qt-funk.blogspot.com/2010/10/fresh-from-oven-qt-extras-for-ubuntu.html

To make your first application with Qt Quick components, you could
use following Qt main program:

#include
<qapplication.h>
#include
<QtComponents/qdeclarativewindow.h>
#include
<qdir.h>

int
main(int argc, char **argv)
{
  QApplication
app(argc, argv);
  QDir::setCurrent(app.applicationDirPath());
  QDeclarativeWindow
window(QUrl::fromLocalFile("main.qml"));
  window.window()->show();
  return
app.exec();
}

Compared to a Qt/QWidget
application, you just should declare
QDeclarativeWindow

and show it. In this first example we don’t try to interface it by
any other way than with our C++ code.

Next
step is UI code with Qt Quick Components. Compared to plain Qt Quick
Qml application, our main element is now Window, not Rectangle and
under window we implement our application UI inside of Page objects.
In the first example we created just an one page but later we add
more of them. Inside of this page we just create one Button component
that is already in our components library and we don’t need to code
it in plain QML. We put couple of Buttons inside of Column just
making easier to add more of them later.

import
Qt 4.7
import com.meego 1.0

Window

{

  id: window
  Component
{
   
id:
mainpageComponent
   
Page
{
    
id:mainPage
    
Column
{
      
anchors.centerIn:
parent
      
spacing:
10
      
Button {

        
height:
50;width: 600
        
text:
"Show a cat"
        
onClicked:(window.nextPage(catComponent))
      
}
      
Button
{
        
height:
50; width: 600
         text:
"Show a dialog"
         onClicked:(window.nextPage(dialogComponent))
      
}
   
}
   }
 
}
  Component.onCompleted:
{
  window.nextPage(mainpageComponent)
 
}
}


To
compile this application, we need also .pro file

TEMPLATE
= app
QT += declarative
LIBS +=-lQtComponents
#
Input
SOURCES += main.cpp
OTHER_FILES
+= \
main.qml

Then
just press “run” from your Qt Creator and this you should see,
you get your application with MeeGo style and all MeeGo window
decorations.

For
real application we need more pages and settings dialog with
scrolling list of option widgets. Current Qt Quick components does
not yet have dialogs that you can populate yourself but in MeeGo many
times sliding pages are already used to implement same function. For
this application i implement two pages one with just Image content
and other being as “settings dialog”.

Settings
dialog, I out content inside of QML Flickable element that implements
surface with kinetic finger scrolling and then Column object for
children component geometry as I did in the main page. I populated this
dialog just for example with Buttons, LineEdit,CheckBox and Switch.

Component
{
  
id: catComponent
  
Page {
    
id:catPage
    
Image {
      
anchors.centerIn: parent
      
source:
"aureo600.jpg"
    
}
  
}
}
Component {
  
id: dialogComponent
  
Page {
    
id:dialog
     Flickable {
      
id: dialogscrolarea
      
anchors.top: parent.top
      
anchors.bottom:
parent.bottom
      
width: parent.width
      
anchors.leftMargin:50;anchors.rightMargin:50
      
contentHeight: dialogcontent.height
      
contentWidth:
parent.width
      
Column {
        
id: dialogcontent
         anchors.left:parent.left;anchors.right:parent.right
        
anchors.leftMargin:50;anchors.rightMargin:50

         spacing:
10
        
Button {
          
text: "Button 1"
          
width:
parent.width
        
}
        
LineEdit {
          
id: line1
          
width:parent.width
          
anchors.left: parent.left; anchors.right:
parent.Right
          
promptText: "Enter text
here"
         }
       
Button {
          
text: "ToggleButton"
          
width:parent.width
          
checkable:true
        }
       
CheckBox {
          
id: cbox
       
}
        Switch
{
          
id: switch1
       
}

Running
this example, you should get the following result. Now you have two
application pages with sliding page transitions and you have dialog
content with kinetic scroll.

This
all is with MeeGo style and MeeGo UX, behaves just as MeeGo
applications should be. If you compare this with QWidgets. In Maemo5
you can implement same function with QWidgets but you don’t have
Switch, in MeeGo Qt you get basic widget style and kinetic scroll but
you don’t have any way to implement sliding stacked windows. Symbian Qt4.7 does not implement kinetic scroll, neither sliding windows nor
multiple windows of any kind.

Maemo
5 and N900

The Forum
Nokia has also released Maemo5 version of Qt Quick Components
package. Thanks to Antonio Aloisio. You can just compile this
example application with Maemo5 PR1.3 Qt4.7 and our qt-components
library from extras-devel and you will get exactly the same looking
application. MeeGo style differs a little bit from Maemo5 native but
even with this small difference, these applications will have
excellent usability on N900. It should not be too big task to hack
code little bit and make variant of components library that has
mostly same style than Maemo5. Only fundamental difference is that
MeeGo applications implement sliding page transition by toolkit,
Mamo5 with Window manager and for that reason, window tittle bar is
here rendered by toolkit, not window manager and that explains
the different look of the home and back button. 

Install
qt-components for your maemo5 scratchbox. You need to have
extras-devel repository /etc/apt/sources.list

deb
http://repository.maemo.org/extras fremantle-1.3 free non-free
deb
http://repository.maemo.org/extras-devel fremantle-1.3 free non-free


At
the moment we have only ARM version, no X86 version because
qt-components depends on libmeegotouch on theme engine and
libmeegotouch is available only as an ARM binary for Maemo5.

[sbox-FREMANTLE-ARMEL:~]>fakeroot
apt-get install qt-components-dev

To
install qt-components to your N900, you need to have extras-devel
repository enabled in application manager and then use the terminal or
ssh:

sudo
gainroot
apt-get install qt-components qt-components-examples

The current
N900 version of qt-components-examples does not yet have desktop files
so you need to run them from the command line. There is also a known bug
that you need to run all components examples with
-graphicssystem
native -option. The current version is developers pre-alpha but I hope
that we can soon deliver a version with desktop files and with these known
bugs fixed.

~
$ /opt/qt-components/gallery/gallery -graphicssystem native

Using
Qt Components from C++

You
may have your application logic made already with C++ and you may be
just considering about implementing a mobile UI. Or you are planning a new
application and you would like it be easilly portable for desktop and
different mobile environments like MeeGo and Symbian. You can
implement all application logic as usual in C++ code and change your
UI layout just loading a  different QML file. You may even implement the
same application binary that can implement handset, tablet and
desktop UX just loading a different QML file. The key element for this is
to make your C++/Qt application interfacing with your QML code.
Signals and slots are the easiest way, you may call slots of your
C++ code directly from the QML code. If you would like to make C++
variables visible to Qml you can do it with
Q_PROPERTY
macro.
The Following example tells more.

The
class itself is just as it was in C++ application, it implements
graphical UI element and for that reason it inherits QgraphicsWidget
and implements paint and boundingRect functions. It has just one slot
for receiving signal from our QML code. No single line of
modifications is needed to the original C++ code. Only change that is
needed is to expose float property called “value” to our QML
code. We need to specify set and get functions value() and
setValue(float) for this variable. The variable is read/write one for
Qml code but if we would like to make our Qml code doing some actions
when this value is changed, we could specify also NOTIFY signal for
it. In our case, this value is only used to change value displayed in
our element so, no notify is needed. That’s all needed to modify your
C++ classes to work with Qt Quick Components UI.

class
GaugeLabel : public QGraphicsWidget
{
  
Q_OBJECT
  
Q_PROPERTY(float value READ value WRITE setValue)
 public slots:
   
void testClicked();
 public:
   
explicit Gauge(QGraphicsItem
*parent = 0);
   
void paint(QPainter *painter,const
QStyleOptionGraphicsItem *option,
QWidget *widget);
   
QRectF boundingRect() const; void
setValue(float val_); float value();
}

To
use our C++ classes from our Qml code, we need add one line to our
example main program, qmlRegisterType.

#include
<qapplication.h>
#include
<QtComponents/qdeclarativewindow.h>
#include
<qdir.h>

int
main(int argc, char **argv)
{
  QApplication
app(argc, argv);
  qmlRegisterType<GaugeLabel>("Efis",
1, 0, "GaugeLabel");
  QDir::setCurrent(app.applicationDirPath());
  QDeclarativeWindow
window(QUrl::fromLocalFile("main.qml"));
  window.window()->show();
  return
app.exec();
}

And
then we can use our class from QML as any QML component, we just need
import it like here as
import
Efis 1.0

. Then in code we just use it as object as any QML native object and
we can spefify it’s size and coordinates. Line
value:valueSlider.value*3 binds value returned Slider component
named valueSlider. Our C++ class setValue(float) is automatically
called every time than we move the slider and value displayed by our
C++ component changes automatically when slider is moved. In Button
component we specify onClicked that calls a slot from our C++ class.

import
Qt 4.7
import Efis 1.0
import com.meego 1.0

Window
{
  
id: window
   Component {
    
id: mainpageComponent
    
Page {
    
id:mainPage
    
GaugeLabel {
     
id: gb
     
x:200;y:200;width:100;height:40
     
value:
valueSlider.value*3
     
gaugeStyle:16
     
name:
"MiuMau"
    }
  Slider
{
    id:valueSlider
   
x:350;y:200
  }
  Button
{
   
id:testButton
   
x:350;y:250;width:160;height:40
   
text:"TestButton"
   
onClicked: { gb.testClicked(); }
  }
 }
 }
 
Component.onCompleted: { window.nextPage(mainpageComponent);
}
}

Final
result looks a like this:

Conclusion

Qt
Quick with Qt Quick Components is the best choice for implementing
new mobile application UI today. Qt Quick Components is at pre-alpha
phase at the moment but it is already usable for starting application
development. We have currently only MeeGo UX supported but it runs on the
desktop, Maemo5 N900 and MeeGo. You can get the latest build done by
Forum Nokia from our PPA and maemo extras-devel repository. When you
start development with current pre-alpha, you can count on that there will be API changes.
Symbian and desktop UX comes later. Interfacing Qt Quick Components
UX to your Qt C++ code is very easy and when all UI is in the QML code,
changing the UX is very easy.

 

Links:

 

http://qt.gitorious.org/qt-components


http://qt-funk.blogspot.com/2010/10/fresh-from-oven-qt-extras-for-ubuntu.html

https://launchpad.net/~forumnokia/+archive/fn-ppa

http://doc.qt.nokia.com/4.7/qtquick.html

 

Qt Creator and Scratchbox

Qt Creator and Scratchbox

  Qt Creator and Scratchbox

Qt Creator is perfect tool for Qt
application development, it is first IDE that i have fallen love and
even as old hacker I have been ready to trade my old emacs to it.
These is one missing feature that so many has asked from me,
scratchbox support. It may be one of most requested feature among
advanced Maemo/MeeGo developers. Currently QtCreator from Nokia SDK does
not support Scratchbox toolchain. Most of current experienced Maemo
developers prefer scratchbox because it allows also development of
complex applications that are using in Linux build tools and it
allows running application under simulated ARM or x86 environment with full
Maemo library and style support. From picture above you can see
exatly same application run under simulator and under scratchbox.

Getting Qt Creator supporting
scratchbox is not so difficult, it just needs some small tweaks.

Make Paths symmetric

First make your paths symmetric under
scratchbox and host Linux environment. That means that if your
application path is /a/b/c/d under host, it is found under same path
under scratchbox. I do this normally doing symlink my directory
scratchbox under scratchbox home directory under
/home/kate/scratchbox, so path to my application should be
/home/kate/scratchbox/myapp under both scratchbox and host Linux.

You can do it with following command on
Linux host.

mkdir
/scratchbox/users/$USER/home/$USER/scratchbox
ln
-s /scratchbox/users/$USER/home/$USER/scratchbox scratchbox

VMWare issues

If you are running your scratchbox
under VMWare virtual machine, you may want to have your working
directory under host filesystem so that files are available also from
your host side. This should least work under Linux and Mac hosts that
both share common unix filesystem schematics. As example in Mac, I
have under my Mac home directory subdirectory scratchbox that is
mounted under my virtual Linux host as /mnt/hgfs . Under my VMWare Linux, i
have from my Linux home directory symbolic link scratchbox ->
/mnt/hgfs/scratchbox .

To have write access you need to have
also matching UID’s in both sides. Under Mac OSX default user is 501
but under Ubuntu it is 1001. To get matching user ID, you should make
your user under Ubuntu have this same UID 501. By default system is
not allowing it but you can change FIRST_UID to 500 and
LAST_SYSTEM_UID as 499 in /etc/adduser.conf

To get this same VMWare host directory
visible under scratchbox, you also need one extra step. Scratchbox is
chrooted environment and it sees only files inside of chroot jail and
this mount should be bind-mount to be visible by command

mount
-o bind /mnt/hgfs/scratchbox
/scratchbox/users/kate/home/kate/scratchbox

Compiler Scripts

To compile, you need to create under
your Linux host two shell scripts /usr/bin/sbox-qmake and
/usr/bin/sbox-make as follows

/usr/bin/sbox-make

#!/bin/sh
/usr/bin/scratchbox
-d $PWD make $@

/usr/bin/sbox-qmake

#!/bin/sh
/usr/bin/scratchbox
-d $PWD qmake $@

You also need make them executable by

chmod
755 /usr/bin/sbox-qmake /usr/bin/sbox-make

Easy way to do it is use following cut
and paste friendly way

 

 echo ‘#!/bin/sh’ >/usr/bin/sbox-qmake;echo ‘/usr/bin/scratchbox -d $PWD
qmake $@’ >>/usr/bin/sbox-qmake;chmod 755 /usr/bin/sbox-qmake
echo
‘#!/bin/sh’ >/usr/bin/sbox-make;echo ‘/usr/bin/scratchbox -d $PWD
make $@’ >>/usr/bin/sbox-make;chmod 755 /usr/bin/sbox-make

Create Scratchbox Qt version under Qt Creator

Under Qt Creator, you should go under
projects, select desktop target because maemo target does not allow
you to chose custom Qt version. Select desktop targer, section
General, give configuration name, as example Sbox-qt, Choose “Manage”
from Qt Version line and open Qt version management dialog. There,
press “+” button and enter as “Version Name” sbox-qt and as
“qmake Location” the location of your sbox-qmake script location
/usr/bin/sbox-qmake . If everything went right, you should see text
“Found Qt version 4.7.0 using mkspec linux-g++ (Desktop)”

 

Qt creator and scratchbox 3

 

When
you return to “Build settings” page, your “Build steps” qmake
should be already correct sbox-qmake. Make is still just “make”,
you should select “details” from Make and set “Override make”
as /usr/bin/sbox-make .

 

Qt Creator and scratchbox 2 

 

That’s all, if everything went correctly, you could go back to your project
and select form menu “Build” and “Build project: your project
name”. It should build it under scratchbox and parsing error
messages should also work.

Running under scratchbox

creator-scratchbox-run

For running your application from scratchbox, you need /usr/bin/sbox-run
script, there is little trick here. Qt Creator expands symbolic
links, so /home/kate/scratchbox becomes
/scratchbox/users/kate/home/kate, scratchbox run-standalone.sh script
does not like that kind of path, so prefix need to be removed

/usr/bin/sbox-run
( for fremantle )

#!/bin/sh
/usr/bin/scratchbox
-d `echo $PWD| sed -e "s_/scratchbox/users/[A-Za-z0-9]*/_/_"`
run-standalone.sh $@

You also need append export DISPLAY=:2
to end of your scratchbox .bashrc, following cut and paste friendly way

echo
export DISPLAY=:2 >>/scratchbox/users/$USER/home/$USER/.bashrc

When
all this is done, start your Xephyr from Linux host by

Xephyr
:1 -host-cursor -screen 800x480x16 -dpi 96 -ac &

and under scratchbox

af-sb-init.sh
start

Under your Qt Creator prohject, go to "Run" settings,  Add "Custom executable" and there sbox-run and name of your executable asargument.

Now you can run your Qt application under scratchbox just pressing green
run symbol from your Qt Creator.

Using Host Qt Creator under Mac

Qt Creator on mac

Because Mac OSX is Unix based, it is with certain limitations possible to
compile under VMWare scratchbox with little tricks. These
instructions are not complete and you may need your own expementing
to get them work. You need to do same thing, make paths symmetric. Under Mac OSX users home
is /Users/<username>, and you need maka same symlink under
scratchbox.

You can run scratchbox commands under VMWare using ssh, so make
following versions of sbox-qmake and sbox-make scripts, replace
kate/kathy as your username and virtual machine IP with your one.

/usr/bin/sbox-qmake

#!/bin/sh
ssh
kathy@172.16.109.212 "scratchbox -d $PWD qmake $@"

/usr/bin/sbox-make

#!/bin/sh
ssh
kathy@172.16.109.212 "scratchbox -d $PWD make $@"

You
also need to set up your mac ssh public key under VMWare Linux
.ssh/authorized_keys .

VMWare has nasty feature to change your virtual machine address in fly and
these scripts have address as hard coded, more advanced scripts could
take this address automatically or then we need find option from
VMWare not to change address.

Before setting new Qt target you should create on mac host empty directory
/usr/include/qt4 and copy /usr/share/qt4/mkspecs from your scratchbox
to mac host filesystem. May be advanced scripts could tweak paths
returned by sbox-qmake -query to point under virtual machine but
tahat’s future project. I have also tried “headless” scratchbox
support using Mac OSX Xephyr as display but leas in my tests Xephyr
has crashed. It may need building from sources up to date Xephyr but
that’s also possible future project. Advantage in Headless version is
that VMWare appliance is completely hidden behind QtCreator.

Using Qt Creator host under Windows

No hope