If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
yalnte
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha
Accepted Solution

BB10 Dev Alpha - "QFontDatabase: Cannot find font directory /base/usr/lib/qt4/fonts"

[ Edited ]

Hi,

 

On my BB10 Dev Alpha device the Qt fonts seem to be located in:

 

/base/usr/lib/qt4/lib/fonts

 

but my app is looking for them here:

 

/base/usr/lib/qt4/fonts

 

How do I make my app look for them elsewhere? How can I set an environment variable to do this please?

 

Thanks in advance,

 

Yalnte

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Please use plain text.
Developer
yalnte
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Re: BB10 Dev Alpha - "QFontDatabase: Cannot find font directory /base/usr/lib/qt4/fonts"

[ Edited ]

I've tried the following additional code, but it is still saying it can't find the fonts in /base/usr/lib/qt4/fonts. I don't seem to be able to move them either (don't have enough permissions apparently).:No:

 

	   QFontDatabase::removeAllApplicationFonts();
	   QString Fpath = "/base/usr/lib/qt4/lib/fonts/helvetica_80_75i.qpf";
	   QFontDatabase::addApplicationFont(Fpath);

 

 

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Please use plain text.
BlackBerry Development Advisor (Retired)
selom
Posts: 60
Registered: ‎05-10-2012
My Device: Blackberry 10 Alpha
My Carrier: none

Re: BB10 Dev Alpha - "QFontDatabase: Cannot find font directory /base/usr/lib/qt4/fonts"

Hello there,

 

to specify the font directory, add the following to your bar file

 

<env var="QT_QPA_FONTDIR" value="/usr/lib/qt4/lib/fonts"/>

 

This fixes the error from QFontDatabase on startup.

 

I noticed you are also attempting to use QtQui in your application, if you were not aware Cascades is a better option and has deeper integration with the system compared to QtQui, so take a look at it if you haven't done so already.

 

Cheers

Selom

Please use plain text.
Developer
yalnte
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Re: BB10 Dev Alpha - "QFontDatabase: Cannot find font directory /base/usr/lib/qt4/fonts"

Thanks very much - that seems to have fixed it.

 

I'd like to use Cascades at some point, but for now I just want to get my app ported across and working in some form!

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Please use plain text.
New Contributor
niharonly
Posts: 6
Registered: ‎01-27-2013
My Device: BB10
My Carrier: Airtel

Re: BB10 Dev Alpha - "QFontDatabase: Cannot find font directory /base/usr/lib/qt4/fonts"

[ Edited ]

Hi,

I have to show the custom fonts only for some of the labels. I have keep my .ttf file in assets folder and used in Label as textStyle.fontFamily: "myfont.ttf". I have also declared





 i tried this link also but all wain

in bar file but though i'm not getting the result. Tell me if i'm wrong anywhere and how to solve this issue. Thanks in advance.

Please use plain text.