QT application without Photon Fonts

Hi,

I’m new to QT library and QNX. I’ve a task to port an existing QT application to the QNX platform. So I created I simple QT application in order to understand how the things work. I managed to run this application on QNX x86 running on VirtualBox. My main task is to port the application to QNX armle-v7 Harman device. The problem is that the version of QNX on the device is modified e.g. it has no photon at all (no ph, no phfont, nothing photon related). Here is where the problem begins. QT applications seems to need photon’s fonts in order to work. And when I start the application it says - “QFontDatabase: Cannot find font directory /usr/photon/font_repository - is Qt installed correctly?”. I see that there is no such directory “/usr/photon” and of course no “/usr/photon/font_repository”. I could try to create it manually and set the fonts inside, but is this the only way? I mean, there should be some way to tell to the QT application to not use photon fonts, or something like that?

Any help is highly appreciated.

Thanks in advance.

Well I find this very curious. I was under the possibly incorrect assumption that Qt deals with fonts on it’s own, independent of anything else on the target system. How else would it be a portable graphics library?

I’ve never tried to run Qt on a QNX system that didn’t have Photon installed. I’ve also been through the Qt source code and thought I had found all the QNX specific changes, none of which had anything to do with using the font manager.

I look forward to finding out if I am wrong about this.

Having had a minute to think about this, I’m going to guess that when you run your program, you direct Qt to the /usr/photon/font_repository directory with an environment variable. This works on the VMWare system because the photon font directory is there, but obviously not on the Harmon system.

As far as I know, the Qt directory is under /usr/local/Trolltech and if you install all the Qt files that belong there, it should work.

Which version of Qt are you using? I think there was a port of Qt 4.7 that was referencing /usr/photon/font_repository, however AFAIR you had to copy some fonts that came with Qt to this location. I’m quite sure Qt does not need Photon’s fonts.

I verified that with Qt Version 4.8.2 under /usr/local/Trolltech/…/lib/font there are font files.

If you would like to compile 4.8.2 under QNX 6.5 I can send you the modified Makefile that allows this to happen.

Hi,

Thanks for the response.

Yes, I’m using the port of Qt 4.7 for QNX. I managed to workaround the problem with the environment variable QT_QWS_FONTDIR. It was empty by default but when I set it to some directory QT uses it.

Now I’ve another issue, but probably it should be posted in another topic. The QT application internally calls gf_dev_attach in order to get ‘handle’ to a io-display device, but this call fails. There is no io-display manager in this modified version of QNX. Currently I’m stuck with this issue and I’m not sure how to proceed. There should be some display manager, but this device lacks of documentation and support information.

Probably I should try with QT 4.8.2 to see if the issues are the same.

Uh, you are barking up the wrong tree here. Qt is a graphical library, but it has no graphics drivers. They have to be supplied by the OS. In QNX 6.4 and up, graphics drivers interface with io-display, and applications talk with io-display. So no io-display equals no graphics modes for the display.

The alternative if that’s what you require would be to modify the Qt interface code. All it does is

  1. Turn graphics mode on and off. If you have a Vesa card this is pretty easy.
  2. Blit rectangle data to the graphics card memory.

The issue will be identical.

Thanks for the responses.

The exact error was “QQnxScreen: gf_dev_attach() failed with error code 2” i.e. a QT call to gf_dev_attach() returns GF_ERR_IODISPLAY. I was unable to found io-display in the whole OS. However, there is UI applications on this device and even our company has a Java application for the device, but I was unable to port the native QT application for this device because of the above problem.
So, I was told to port the requested application to x86 QNX running on Virtual Machine. The things work there.

Hmmm. Well reading this suggests another possibility. You say you can’t find io-display anywhere but there is a UI application on the device. Reading between the lines, by UI application, you mean a graphical UI application? If so you are using a graphics driver. In all likelyhood you are using io-device but don’t know it. Try this:

pidin | grep io-display

If you find io-display running then read on. If not, I have no idea what you are running on this machine. It sounds pretty custom, and if so, no one here will be able to help you.

Ok, the system has io-display running but you can’t attach to gf? That’s because only one process can attach to the same display. Not entirely true, but approximately so. So something else is already running that is attached to gf. What could that be? Photon? Another Qt program? An OpenGL program? Qt has a way to resolve this when multiple Qt programs want to run. Otherwise you will be dealing with a very low level of QNX graphics internals. To fix this, you will need to know exactly what is going on. What about this JAVA application? Maybe the Virtual machine has taken over the graphics screen?

What do you mean by “modified version of QNX”? Which version of QNX is it? If it is pre 6.4, then yes there is no io-display, there is io-graphics instead. The stock Qt4.7 port won’t work.

Sorry, that I didn’t answer earlier, but I was busy with my new task.

I ran the command - pidin | grep io-display and it gave empty result i.e. there is no io-display.
I did the same thing for io-graphics. I ran the command - pidin | grep io-graphics and it gave empty result i.e. there is no io-graphics.

I said that the OS system is modified because it has no photon stuff and it has no io-display stuff.

The gf_… call is made by QT internally when I try to start the simple QT application. And it gives the putty console (I’ve no console on the device).

I don’t know the exact version of QNX on the device, because I’m unable to check it - the command “uname -a” doesn’t work. It works on the VirtualBox QNX.
I’m not able to check the version of the QNX from the device GUI, too. It’s UI is very limited. I know that my explanations sounds weird. I was told by my boss that the device has QNX on it.
It’s a Harman device used in cars. I’m starting to thing that this is QNX Car probably. I’m not sure.

However, thank you for your help and for your time. This task is currently frozen and they’ll probably return me to it after several weeks.

Whether you don’t have io-display because you are pre QNX 6.4 or because you just don’t have it, you are SOL. You need it to run Qt.

It could as well be something that Harman did on their own. Automotive companies often have too many engineers/resources and start re-inventing the wheel “because they can”. Of course what they do is better than anything else.

You will need a contact at Harman who can tell you something about this device and how graphics are being displayed, else you will not be able to get Qt to do anything.