Developing with Qt Commercial for INTEGRITY on Windows : A Step-by-Step Guide To Configure and Compile Qt Commercial on INTEGRITY

With the release of Qt Commmercial 4.8.0,  we announced official support for INTEGRITY 10.02, but at that time only Linux host was supported for development. Now we eased the work of developers who are more familiar with using Windows host as a development environment by announcing official Windows host support for INTEGRITY 10.02 on Qt Commercial 4.8.2. I will go through what you need to do for cross-compiling Qt Commercial applications for INTEGRITY using a Windows development host. 

 

INTEGRITY support is distributed only as a source release, but it's easy to configure and compile Qt Commercial for INTEGRITY with a few simple steps. All Qt applications built for INTEGRITY are statically linked so the only thing that needs to be copied to the actual INTEGRITY target besides the Qt application itself are the fonts that the application is using.

 

Qt Commercial for INTEGRITY also contains a screen driver based on the gh_FB FrameBuffer API and a connection-based mouse and keyboard input drivers. Depending on INTEGRITY BSP you might already have a suitable FrameBuffer driver for your hardware. If a suitable FrameBuffer driver doesn't exist for your, HW you can still test Qt Commercial on your HW by utilizing the default VNC screen driver. For testing purposes also virtual embedded x86 target can be used. For more information about these drivers, please refer to Green Hills Software standard support.

 

 

Steps to configure and compile Qt Commercial for INTEGRITY on your Windows host:

 

1. In the directory where you extracted the Qt source run the configure.exe:

configure -embedded -xplatform qws/integrity-x86-cx86 -hostprefix %CD% -prefix / -qt-sql-sqlite -nomake examples -nomake demos

 

2. Once configure is completed edit the generated projects.gpj -file

Change following line to point to your INTEGRITY install directory:

macro __OS_DIR=/enter/your/path/to/INTEGRITY

to e.g.

macro __OS_DIR=c:ghsint1002

Change following line to indicate the bsp you are using

-bsp enter_your_bsp_name_here

to e.g.

-bsp pcx86

 

3. open projects.gpj in Multi and compile the project

* Qt is now build for INTEGRITY 10.02

 

 

Preparing your INTEGRITY target:

 

The only thing you need to do is to copy the fonts from your QtDirectory/lib/fonts to the INTEGRITY target /lib/fonts -directory. After this your target is ready to run Qt applications. You probably won't need all the fonts but for testing purposes it's easier to copy them all to the target and when your application is ready you can just delete the ones you don't need.

 

 

Developing and compiling your Qt application for INTEGRITY:

 

Develop your application using e.g. Qt Commercial Creator and after you are ready to deploy the application to the INTEGRITY target cross compile it with MULTI.

 

While developing the application on the host machine, please keep the limitations of the Qt Commercial on INTEGRITY port in mind. A detailed list of limitations can be found from in the Qt Commercial documentation for INTEGRITY documentation found in the download packages.

 

In this case we can make cool “Hello Windows!” application with the text editor as follows:

 

Source code LISTING for the application (main.cpp):

 

#include <QApplication>
#include <QPushButton>

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

QPushButton hello("Hello Windows!");
           hello.resize(100, 30);

hello.show();
           return app.exec();
}

 

Steps to compile your Qt application for INTEGRITY:

 

1. Create the needed Qt project file by running qmake in project file generation mode in the application directory

           qmake -project

 

2. Create the needed MULTI project file (.gpj) by running qmake in the application directory

qmake

 

3. Add the generated hello.gpj as a part of your Qt-project in MULTI

 

 

Right click the Qt top project file and select Modify Project -> Add Item…

 

 

From the new window select MULTI Project File and click Next

 

 

In the file selection dialog go to your application directory and choose the main .gpj file, in this case hello.gpj, and click Add.

 

 

Now you can see your application as a part of the Qt-project

 

4. Compile the application in MULTI

 

 

Right-click your application and select Build Dynamic Download.

 

Once the building process is completed your application is ready to be launched on the INTEGRITY target.

 

 

Running Qt applications on INTEGRITY target

 

Basically, you have two ways to test your applications on INTEGRITY target. You can either copy the application to the target via FTP and run it from there or you can use MULTI Debugger to run the application.

 

Running the application via FTP method:

- Copy your application binary to the target via FTP

- Connect to the target via telnet using port 8081

- Run you application with run command

run hello

 

Running the application via MULTI Debugger:

 

 

Choose connect from MULTI top menu.

 

 

Select Custom from Connection Chooser.

 

 

Type in rtserv2 followed by targets IP-address or hostname and click Connect.

 

 

Now you can see new Debugger window, which shows all kinds of information of your INTEGRITY target.

 

 

Once you are connected to the target you can upload you application by right clicking your application project and selecting Load Module.

 

 

While your application is being loaded to the target you can see the loading process in the MULTI debugger window

 

By default, Qt applications are set to run automatically, so after loading is completed you should see your application running on the target.

 

In any way you choose to load and launch it, you should see your cool application running on INTEGRITY target.

 

 

“Hello Windows!” running on INTEGRITY target.

 

That's it. Happy coding! :)


Comments