Search code examples
qtqnxqnx-neutrino

Running Qt applications on QNX


I'm trying to get Qt applications running on QNX 4.5. I've compiled Qt 4.6.3 on a linux box with this configuration:

./configure -xplatform unsupported/qws/qnx-i386-g++ -embedded i386 -no-gfx-linuxfb -no-mouse-linuxtp -no-kbd-tty -no-qt3support -qt-gfx-qnx -qt-mouse-qnx -qt-kbd-qnx -no-exceptions -little-endian -nomake demos -nomake examples

"make" required certain tweaking of environment and commenting out one function, but worked in the end. I've copied fonts and compiled Qt libraries onto QNX running in VMware, and created a sample Qt app (it just displays a button) which I compiled on my linux box and copied over to QNX.

I have a little script to launch the app:

io-display -d vid=0x15adh,did=0x405h
/usr/photon/bin/devi-hid -Pr kbd mouse
./app

Which runs the application, enabling experimental input drivers. With this script I was able to get somewhere by running the Qt app in Photon - screen rendering gets all screwed up, but I do see my Qt application.

However, if I exit Photon into a text mode, and try to run the application from there (using a slightly modified script with different vid and did values for launching the graphics server), I just see a blank screen.

I'm completely new to QNX and Qt, so I'm a bit stuck right now. I'm trying to read up on how Photon works and what kind of environment it sets up, to find what I might be missing in the text mode. However, I'm not sure this is even a right direction, so I thought I'd ask good folks on SO, in case somebody went through this before :)

cheers!


Solution

  • Have you tried adding "-qws" after you app? It tells the Qt app to initialize it's windowing system (qws). Only 1 qt app needs (or may have) the option specified.

    I would also add a couple of environment variables to help Qt to know where to find your keyboard and mouse. (I also am not sure if you really need the first line.)

    io-display -d vid=0x15adh,did=0x405h
    
    /usr/photon/bin/devi-hid -Pr kbd mouse
    
    export QWS_DISPLAY=qnx
    export QWS_MOUSE_PROTO=qnx
    export QWS_KEYBOARD=qnx
    
    ./app -qws
    

    BTW, QNX has just released a port of Qt 4.7.1 for QNX 6.5. It can be found on the Foundry 27 Qt Project site.