Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - QNX 6.5 with Qt4 - jpg - pictures: (11 Items)
   
QNX 6.5 with Qt4 - jpg - pictures  
Hi again :)

following problem:

I tried to load .jpg - pictures into a QPixmap. Momentics is compiling without errors, but the pictures are not shown.
(on my Beagleboard) Under usr/lib/qt4/plugins/imageformats I can find a libqjpeg.so
With this it should be possible to display jpegs, or not?
Re: QNX 6.5 with Qt4 - jpg - pictures  
Jpegs are definitely displayable on beagleboard with Qt4.
Re: QNX 6.5 with Qt4 - jpg - pictures  
In the internet I have read a lot, that you have to add a plugin for using jpeg (Linux and windows).
I am using your Demo for Beagleboard as a basic.
Is this plugin already integrated?

Just trying to figure out what the problem could be, because the naming and path is correct..
Re: QNX 6.5 with Qt4 - jpg - pictures  
Yes, my beagleXM image is configured to use jpg plugin.  The "tabs" and "wvframe" examples plus the alternate content 
for qTstat all load jpg's from QML.
Re: QNX 6.5 with Qt4 - jpg - pictures  
ok, "maybe" here lies the problem.

I want to display the jpg´s with a QPixmap and not with QML. Is it possible that the plugin is only working for QML?
The load function is working properly on the host machine.
Re: QNX 6.5 with Qt4 - jpg - pictures  
So I checked now a few things and this is what I found out:

The programs you told me with the jpg`s are running well like you said if I use a terminalprogram and the shell.
If I use momentics then I have stopped the shell "sh" and provide some environments via momentics.
Now if I start "tabs" or "wvframe" via momentics with "-qws &" then the jpg can not be read and I get the following  message:
>> QQnxScreen: Attached to Device, number of displays: 1
>> QQnxScreen: Attached to Display 0, resolution 800x600, refresh 60 Hz
>> file:///tabs/content/tabs.qml:73:9: QML Image: Error decoding: file:///tabs/content/images/tab_r.jpg: Unsupported 
image format
>> file:///tabs/content/tabs.qml:48:9: QML Image: Error decoding: file:///tabs/content/images/tab_c.jpg: Unsupported 
image format
>> file:///tabs/content/tabs.qml:23:9: QML Image: Error decoding: file:///tabs/content/images/tab_l.jpg: Unsupported 
image format

Does this mean I am missing some environment variables for jpg?
Re: QNX 6.5 with Qt4 - jpg - pictures  
>>>Does this mean I am missing some environment variables for jpg?
Yep.  You can correct this by creating a file /root/.profile and export'ing the same variables which you see in the 
serial console when you type "set".
Re: QNX 6.5 with Qt4 - jpg - pictures  
For reference, the environment variable QT_PLUGIN_PATH must be set for Qt4.8.x, i.e.

QT_PLUGIN_PATH=/usr/lib/qt4/plugins

(It is not required with Qt 4.7 libraries.)
Re: QNX 6.5 with Qt4 - jpg - pictures  
Ok, i now tried to export everything I see when I type "set". The resulting .profile-file looks now like this:
(The "#" marks the point after which I exported the additional values. the 6 exports before were already writen in the 
file)

>> export QWS_DISPLAY=qnx
>> export QWS_KEYBOARD=qnx
>> export TMPDIR=/ramdisk
>> export QWS_MOUSE_PROTO=qnx
>> export QT_PLUGIN_PATH=/usr/lib/qt4/plugins
>> export PATH=/proc/boot:/sbin:/bin:/usr/sbin:/usr/bin
###############################################
>> export RANDOM=4548
>> export SECONDS=64
>> export SHELL
>> export SYSNAME=nto
>> export TERM=vt100
>> export TMOUT=0
>> export TMPDIR=/ramdisk
>> export _=set
>> export GRAPHICS_ROOT=/usr/lib/graphics/omap3730
>> export HOME=/
>> export IFS='
>> export '
>> export KSH_VERSION='@(#)PD KSH v5.2.14 99/07/13.2'
>> export LD_LIBRARY_PATH=:/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib:/usr/photon/lib:/usr/photon/lib:/tmp
>> export MAILCHECK=600
>> export OPTIND=1
>> export PATH=:/proc/boot:/bin:/usr/bin:/opt/bin:/usr/photon/bin:/sbin:/usr/sbin
>> export PPID=1
>> export PS1='# '
>> export PS2='> '
>> export PS3='#? '
>> export PS4='+ '
>> export PWD=/

Unfortunately nothing changes. doesn`t matter if I start the binary from the board or send it from Momentics to the 
board.
But starting from shell the images are loaded, but nothing is displayed on the monitor...
Re: QNX 6.5 with Qt4 - jpg - pictures  
I played a bit around with the variables and added PATH and LD_LIBRARY_PATH to the environment variables in the run 
configurator of momentics.
Now I can load the jpg´s if I start the program from my hostmachine and send it to the board.

BUT if I start the program binary directly from the board (via momentics ), the jpg´s still are not loaded.
Could it be that the needed environment variables are deleted if I kill the shell?
How can I set these variables without starting the shell again?

already tried to export these again after killing the shell in the rc.local-file, but then the OS is freezing. 
(It looks like, because gf_splash is not killed which is before starting the program and killing the shell in rc.local)
Re: QNX 6.5 with Qt4 - jpg - pictures  
Ok, working now.

I added the environment variables before starting the program and also before killing the shell.
Another way would be:
LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dl ./program_name -qws &