Qt Reference Documentation

Installing Qt for VxWorks

This page contains information about the Qt Commercial port for VxWorks. More information about the combinations of platforms and compilers supported by Qt Commercial can be found on the Supported Platforms page.

Supported Versions

Qt Commercial has been tested on Wind River VxWorks 6.9.2 in both DKM and RTP mode using the vendor supplied GCC or DIAB compiler, targeting the x86 simulator, IA and ARM/ARM-v7 devices.

Other Limitations

  • Running multiple Qt GUI applications simultaneously on QWS is only supported on RTP mode.
  • Hardware acceleration (OpenGL ES 2.0) is available in DKM on selected hardware targets.

Development environment setup

Installing the License File

Qt Commercial edition of Qt for VxWorks, the first step is to install your license file.

For linux: Copy file to $HOME/.qt-license

For Windows: Copy file to C:\Documents and Settings\<Username>\.qt-license

Qt for VxWorks needs to be cross-compiled on a host machine. Building the Qt for VxWorks simulator (VxSim) would be done like this:

Building and Installing Qt on Window host

Before configuring Qt:

  • Install MinGW C and C++ compilers version 4.4.0. MinGW-gcc440.zip is downloadable via Qt Customer Portal.
  • Install Strawberry Perl 32-bit from http://strawberryperl.com/
  • Make sure that MinGW and Perl binaries are in PATH and that MinGW is in PATH before Perl by opening Windows Command Prompt and entering PATH command.
  • Start VxWorks development shell by command wrenv -p vxworks-6.9 in your Windriver installation directory.
  • MinGW and Perl binaries must be in PATH in VxWorks Development Shell as well.

Before building the Qt for VxWorks library, run the configure.exe to configure the library for your development architecture. You can list all of the configuration system's options by typing

 configure -help

The Configuration Options for Qt page gives a brief overview of these.

Configuration for QWS DKM on Windows host:

 configure -static -release -embedded -platform win32-g++ -xplatform qws/vxworks-simdkm-g++ -make make -hostprefix %CD% -prefix /tmp/qtsimdkm -qt-sql-sqlite -no-script -nomake examples -nomake demos
  • -static - selects building statically i.e. DKM (Downloadable Kernel Module) mode
  • -release - selects building release version of Qt (debugging turned off)
  • -embedded - builds the embedded version of Qt
  • -platform win32-g++ - selects host operating system as windows 32-bit and compiler as g++
  • -xplatform qws/vxworks-simdkm-g++ - selects the x86 simulator mkspec for VxWorks
  • -make - uses make binary as a build command
  • -hostprefix %CD% - sets Qt location in host machine to current directory
  • -prefix - sets Qt location in target machine. In this case target is VxSimulator
  • -qt-sql-sqlite - links sqlite directly into the Qt library
  • -no-script - disables QtScript, QtScriptTools, QtDeclarative support because DKM build is static
  • -nomake examples - disables building examples. See detailed info from section General Notes.
  • -nomake demos - disables building demos. See detailed info from section General Notes.

Configuration for QWS RTP on Windows:

 configure -release -embedded -platform win32-g++ -xplatform qws/vxworks-simrtp-g++ -make make -hostprefix %CD% -prefix /tmp/qtsimrtp -no-webkit -nomake examples -nomake demos

Note: QtWebkit is not currently supported when cross compiling Qt on Windows host.

  • -release - selects building release version of Qt
  • -embedded - builds the embedded version of Qt
  • -platform win32-g++ - selects host operating system as windows 32-bit and compiler as g++
  • -xplatform qws/vxworks-simrtp-g++ - selects the x86 simulator mkspec for VxWorks
  • -make - uses make binary as a build command
  • -hostprefix %CD% - sets Qt location in host machine to current directory
  • -prefix - sets Qt location in target machine. In this case target is VxSimulator
  • -no-webkit - disables QtWebKit support
  • -nomake examples - disables building examples. See detailed info from section General Notes.
  • -nomake demos - disables building demos. See detailed info from section General Notes.

Building Qt on Windows

 set WIND_WORKSPACE_PATH=<WindRiver workspace>
 make

Install Qt libraries to correct path on Windows

Copy directories from Qt build directory to directory given by -prefix option when configured Qt. e.g. C:\tmp\qtsimdkm

For DKM: Copy lib and demos directories:

 xcopy C:\<path to Qt builddir>\lib C:\tmp\qtsimdkm\lib /e /i
 xcopy C:\<path to Qt builddir>\demos C:\tmp\qtsimdkm\lib /e /i

For RTP: Copy lib, demos, plugins and imports directories:

 xcopy C:\<path to Qt builddir>\lib C:\tmp\qtsimrtp\lib /e /i
 xcopy C:\<path to Qt builddir>\demos C:\tmp\qtsimrtp\demos /e /i
 xcopy C:\<path to Qt builddir>\plugins C:\tmp\qtsimrtp\plugins /e /i
 xcopy C:\<path to Qt builddir>\imports C:\tmp\qtsimrtp\imports /e /i

Building and Installing Qt on Linux host

Before building the Qt for VxWorks library, run the ./configure script to configure the library for your development architecture. You can list all of the configuration system's options by typing

 ./configure -embedded -help

The Configuration Options for Qt page gives a brief overview of these.

Configuring Qt:

Configuration for QWS DKM on Linux:

 ./configure -static -xplatform qws/vxworks-simdkm-g++ -embedded vxworks -exceptions -no-gfx-linuxfb -no-mouse-linuxtp -no-mouse-pc -no-kbd-tty -qt-gfx-vxworksfb -qt-mouse-vxworks -qt-kbd-vxworks -qt-sql-sqlite -no-largefile -no-script
  • -static - selects building statically i.e. DKM (Downloadable Kernel Module) mode
  • -xplatform qws/vxworks-simdkm-g++ - selects the x86 simulator mkspec for VxWorks
  • -embedded vxworks - builds the embedded version of Qt and sets the architecture to VxWorks
  • -exceptions - enables exception support needed for QtXmlPatterns
  • -no-gfx-linuxfb, -no-mouse-linuxtp, -no-mouse-pc and -no-kbd-tty are Linux specific and won't work on VxWorks
  • -qt-gfx-vxworks - enables the VxWorks screen driver
  • -qt-mouse-vxworks - enables the VxWorks mouse driver
  • -qt-kbd-vxworks - enables the VxWorks keyboard driver
  • -qt-sql-sqlite - links sqlite directly into the Qt library
  • -no-largefile - disables largefile support
  • -no-script - disables QtScript, QtScriptTools, QtDeclarative support because DKM build is static

Configuration for QWS RTP on Linux:

 ./configure -xplatform qws/vxworks-simrtp-g++ -embedded vxworks -exceptions -no-gfx-linuxfb -no-mouse-linuxtp -no-mouse-pc -no-kbd-tty -qt-gfx-vxworksfb -qt-mouse-vxworks -qt-kbd-vxworks -no-largefile -nomake examples
  • -xplatform qws/vxworks-simrtp-g++ - selects the x86 simulator mkspec for VxWorks
  • -embedded vxworks - builds the embedded version of Qt and sets the architecture to VxWorks
  • -exceptions - enables exception support needed for QtXmlPatterns
  • -no-gfx-linuxfb, -no-mouse-linuxtp, -no-mouse-pc and -no-kbd-tty are Linux specific and won't work on VxWorks
  • -qt-gfx-vxworks - enables the VxWorks screen driver
  • -qt-mouse-vxworks - enables the VxWorks mouse driver
  • -qt-kbd-vxworks - enables the VxWorks keyboard driver
  • -no-largefile - disables largefile support
  • -nomake examples - disables building examples. See detailed info from section General Notes.

Building and installing on Linux

 export WIND_WORKSPACE_PATH=<WindRiver workspace>
 make
 make install

Configuration for single QWS Qt application, e.g. non QWS server/client:

By default QWS RTP Qt build has server/client support, e.g. ability to run multiple Qt application simultaneously. See QWS architecture for more info. This will add dependency to QtNetwork library for all Qt applications, and if this is not desired, it is possible disable the QWS server/client feature when configuring Qt. To disable this feature, simply add following to your configure line. After disabling feature, there is no need to pass the -qws argument for the Qt executable.

 -DQT_NO_QWS_MULTIPROCESS

Configuration for QPA:

To configure Qt to use Qt Platform Abstraction (QPA) instead of QWS, replace the following configure option with QPA specific

FROM:

 -xplatform qws/vxworks-simrtp-g++ -embedded vxworks

TO:

 -xplatform qws/vxworks-simrtp-g++ -qpa -arch vxworks

Configuration for Minimal Qt:

The Qt installation can easily be optimized by avoiding to compile in the features that are not required. See more from Fine-Tuning Features in Qt.

To configure Qt for using minimal-vxworks, use following options:

 -qpa -arch vxworks -xplatform qws/vxworks-simdkm-g++ -qconfig minimal-vxworks -D QT_QPA_VXWORKS -static -release -exceptions -no-freetype -qt-zlib -no-libpng -no-libtiff -no-libjpeg -no-libmng -no-largefile -no-openssl -no-mmx -no-3dnow -no-sse -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-neon -qt-gfx-vxworksfb -qt-mouse-vxworks -no-gfx-linuxfb -no-gfx-multiscreen -no-mouse-pc -no-mouse-linuxtp -no-kbd-tty -no-xmlpatterns -no-script -no-webkit -no-qt3support -nomake examples -nomake docs -nomake translations-nomake demos

Qt provides several ready-made custom configuration files for VxWorks. These files are located in the <qt_install_dir>/src/corelib/global directory in the Qt source distribution.

  • minimal-vxworks - minimal Qt
  • embedded-widget-vxworks - embedded widget Qt
  • minimal-qtquick-vxworks - minimal Qt with QtQuick support for QWS
  • qtquick-vxworks - minimal Qt with QtQuick support for QPA

If -prefix option was not given to when running configure script, by default Qt will be installed to /usr/local/Trolltech/QtEmbedded-4.8.7-vxworks-dkm or /usr/local/Trolltech/QtEmbedded-4.8.7-vxworks-rtp

Hardware support

There exist many cross-compile configurations for Qt for VxWorks for supporting multiple processor architectures. Available configurations can be found from directory <qt_install_dir>/mkspecs/qws with prefix vxworks- before architecture and VxWorks mode (DKM/RTP).

Following is example howto configure and build Qt for VxWorks for ARM7 hardware for RTP mode.

  • Configure:
     ./configure -xplatform qws/vxworks-arm7rtp-g++ -embedded vxworks -exceptions -no-gfx-linuxfb -no-mouse-linuxtp -no-mouse-pc -no-kbd-tty \
     -qt-gfx-vxworksfb -qt-mouse-vxworks -qt-kbd-vxworks -no-largefile -nomake examples -prefix /sd0:1/qtarm7rtp -hostprefix /tgtsvr/qtarm7rtp
  • Build:
     export WIND_WORKSPACE_PATH=<WindRiver workspace>
     make
     make install
  • -prefix" <dir> option in the configure above points to the dir where Qt will be installed on target filesystem
  • -hostprefix" <dir> option in the configure above points to the dir where Qt will be installed on host filesystem.
  • Note: by default Qt will use -rpath linker flag to set the library install path as a runtime library path. If this is not preferred, it can be disabled with -no-rpath configure option and then using LD_LIBRARY_PATH environment variable

Running Qt applications

  • Start Wind River VxWorks simulator (VxSim)
     vxsim -f path/to/vxsimimage/vxWorks -size 800M
  • Start your DKM application with taskSpawn from VxWorks C shell with following commands:
     cd "path_to_qt_install_dir/demos/affine"
     ld < affine
     taskSpawn("main", 200, 0x01000000, 0x100000, main, 0,0,0,0,0,0,0)
  • Start your QWS RTP application with rtpSp from VxWorks C shell with following commands:
     putenv "QWS_DATA_HOME=/tmp"
     putenv "QWS_CACHE_HOME=/tmp/data/"
     cd "./demos/affine"
     rtpSp("affine -qws", 200, 0x100000, 0, 0x01000000)

    Note: For Windows it is necessary to set LD_LIBRARY_PATH environment variable

     putenv "LD_LIBRARY_PATH=/path_to_qt_install_dir/lib"
  • Start your QPA RTP application with rtpSp from VxWorks C shell with following commands:
     cd "./demos/affine"
     rtpSp("affine -platform vxworksfb", 200, 0x100000, 0, 0x01000000)

    Note: For Windows it is necessary to set LD_LIBRARY_PATH and QT_QPA_PLATFORM_PLUGIN_PATH environment variables

     putenv "QT_QPA_PLATFORM_PLUGIN_PATH=/path_to_qt_install_dir/plugins/platforms"
     putenv "LD_LIBRARY_PATH=/path_to_qt_install_dir/lib"

Running multiple Qt RTP applications (QWS server/client)

It is possible to run multiple Qt RTP applications simultaneously, then server Qt application will control access to the UI and input related hw interfaces e.g. display, mouse, keyboard. All client related painting to the hw screen are handled by the QWS server application. See QWS architecture for more info.

  • Start Qt QWS server application
     rtpSp("server -qws", 200, 0x100000, 0, 0x01000000)
  • Start Qt QWS client application
     rtpSp("client", 200, 0x100000, 0, 0x01000000)
  • Note: QDirectPainter is not currenty supported on VxWorks.
  • Note: Do not configure Qt with -DQT_NO_QWS_MULTIPROCESS, it will disable server/client feature
  • Note: Only Qt QWS applications can run multiple at the simultaneously, not QPA.

Running Qt applications with arguments

  • Keep in mind that VxWorks doesn't call your main() function with the standard argc/argv parameters when starting DKM applications. So you need to add a special vxmain() function to translate VxWorks commandline arguments to an argc/argv array.
     int main(int argc, char **argv)
     {
         QApplication app(argc, argv);
    
         ... your code here ...
    
         return app.exec();
     }
    
     static char *vxargv[6];
    
     int vxmain(int argc, char *argv1, char *argv2, char *argv3, char *argv4, char *argv5, char *argv6)
     {
         vxargv[0] = argv1;
         vxargv[1] = argv2;
         vxargv[2] = argv3;
         vxargv[3] = argv4;
         vxargv[4] = argv5;
         vxargv[5] = argv6;
         return main(argc, vxargv);
     }
  • Then start DKM your application with taskSpawn from VxWorks C shell with following format where application name is the first argument:
     taskSpawn("vxmain", 200, 0x01000000, 0x100000, vxmain, 6, "yourappname", "argv2", "argv3", "argv4", "argv5", "argv6")
  • Starting RTP application with commandline parameters does not need above extra function. Use the following format to start your RTP application with commandline parameters from VxWorks C shell.
     rtpSp("yourapp -arg1 -arg2 -arg3 -arg4 -arg5 -arg6", 200, 0x100000, 0, 0x01000000)

Font support at Qt for VxWorks

Qt supports a multiple font formats on VxWorks including: TrueType (TTF) and Qt pre-rendered fonts (QPF2). QPF2 fonts can be generated from TTF fonts by using the makeqpf tool. See more information about Qt embedded fonts.

By default QWS Qt applications share rendered glyphs for fonts between processes. It can be disabled by adding the following to the QWS server application environment before starting it.

 putenv "QWS_NO_SHARE_FONTS=1"

It is possible to disable sharing rendered glyphs feature completely by adding following definition for configure script when compiling Qt.

 -DQT_NO_QWS_SHARE_FONTS

Note: Sharing rendered glyphs generated from font files (TTF, QPF2) requires that the underlying filesystem used for storing font files must provide POSIX-conforming inode information (for example, HRFS). If fonts are not in the default Qt font directory <qt_install_dir>/lib/fonts, use following environment variable to contain the fonts directory:

 putenv "QT_QWS_FONTDIR=/tmp"

General Notes

  • VxWorks "Munching" feature (generating constructors/destructors for static C++ objects) is done automatically by a special qmake extension (for both static libraries and executables) for DKM applications
  • Some examples will fail to build, due to some missing dependencies (e.g. QProcess, QSharedMemory), especially for DKM which has more limited set of features compared to RTP.