After Nokia acquisition of Trolltech, QT has become an even more interesting framework/tool for UI and graphics development. The new release 4.6 can be obtained under LGPL license and comes with a new integrated IDE for software development (QT Creator) with many demos, some of them using OpenGL.
In order to create an environment to create, simulate and cross-compile, it's needed to build three versions of QT:
Qt/X11, qmake-x11. This is the Qt version that you will be using on your PC. It is also used for building the tools, such as Designer and Linguist.
Qt/QVFb, qmake-qvfb. This is an embedded Qt configuration that runs on host, but works with the virtual framebuffer instead of the actual screen. It let’s you emulate the target system, but run your code on your host machine.
Qt/target, qmake-target. This is the embedded Qt configuration that runs on your target platform. This is what you use to build an actual application running on your embedded device.
On Host you need TO install following package (for Ubuntu distri) to install this QT toolsuit:
Extract downloaded Qt package (from here) and install it by running:
./configure
make
sudo make install
Qt will be installed on /usr/local/Trolltech/Qt-version directory.
We also need to build qvfb tool that will provide virtual framebuffer for X11. To build and install it run:
cd tools/qvfb
make
sudo make install
qvfb will be installed on /usr/local/Trolltech/Qt-version/bin directory.
Building Qt/QVFb
To build Qt/QVFb, will be needed some parameters on configure file. Extract again Qt package on other folder and build as following:
./configure -embedded -qt-gfx-qvfb -qt-kbd-qvfb -qt-mouse-qvfb -prefix /usr/local/Trolltech/Qt-qvfb-version
make
sudo make install
Used parameters:
-qt-gfx-qvfb, the graphics driver will be for QVFb, i.e., the virtual framebuffer.
-qt-kbd-qvfb, the keyboard input will come from the QVFb.
-qt-mouse-qvfb, the mouse input will come from the QVFb.
-prefix /usr/local/Trolltech/Qt-qvfb-version, the prefix is used to separate the QVFb version of embedded Qt from the target version.
Testing QVFb
So far you have two versions of Qt:
1. Qt/X11 built for PC host using X11 and located at /usr/local/Trolltech/Qt-version
2. Qt/QVFb built for PC host using Qt virtual framebuffer and located at /usr/local/Trolltech/Qt-qvfb-version
Call qvfb from X11 version
cd /usr/local/Trolltech/Qt-version/bin
./qvfb &
A simple virtual framebuffer will open. To change screen configuration and add a skin, click in "file -> configure". The following window will open:
i.e., choose ClamshellPhone and click ok. A cell phone skin will open.
On QVFb version, there are a lot of example applications that can be run using Qt virtual framebuffer.
Let's open fluidlauncher demo:
cd /usr/local/Trolltech/Qt-qvfb-version/demos/embedded/fluidlauncher
./fluidlauncher -qws
The argument -qws is used to inform that the application will run on Qt virtual framebuffer.
Building Qt/Target
To build Qt for target (i.MX), it's necessary to build Ltib with some required packages. In this example, a kernel and rootfs will be built for i.MX51 EVK with the following extra packages.