Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to replace qt.conf?

Tags:

qt

I'm working on an embedded system. The directory /root/txpa/images/current/application/bin contains the file qt.conf, the content of which looks like this:

[Paths]
Prefix=/qtdir
Libraries=/qtdir/lib

/qtdir/lib/fonts is about the only thing in the path, and it contains several fonts of kind Vera. These are the only fonts in the system, and the app itself doesn't use them directly. Qt does.

I've been asked to remove qt.conf from its current directory, but if I do the app doesn't start (I suppose Qt can't find any fonts). How would i do this? I've read about Qt resource system, but I'm not sure how to go about doing this.

like image 713
Arlen Avatar asked Dec 04 '25 11:12

Arlen


1 Answers

These are the steps I had to follow in order to resolve this problem:

First, create a qt_conf.qrc file that looks like this:

<!DOCTYPE RCC><RCC version="1.0">
  <qresource prefix="/qt/etc/">
    <file>qt.conf</file>
  </qresource>
</RCC>

QLibraryInfo will load qt.conf from :/qt/etc/qt.conf using the resource system. That should explain the above qt_conf.qrc.

Second, copy the qt.conf file to the same directory as the qt_conf.qrc file (this can be changed, of course).

And finally, update the *.pro files, if any, and rebuild. The original qt.conf file can be removed from the directory that it was in.

like image 117
Arlen Avatar answered Dec 07 '25 14:12

Arlen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!