[Development] Modify QLibraryInfo to support any default location of qt.conf

Henry Skoglund fromqt at tungware.se
Thu Jan 28 12:03:53 CET 2016


this is the same problem that the Qt installation program has, it solves 
it by binary patching your copy of Qt5Core.dll when it installs Qt onto 
your computer (e.g. set qt_prfxpath="C:\Qt\5.5\msvc2013").

Maybe you can to the same?

Or perhaps a more viable long-range solution is to introduce a r/w API 
to Qt's resource system, so that instead of patching Qt5Core.dll it 
would be possible to patch the contents of the embedded 
":/qt/etc/qt.conf" resource file inside your .exe file. (That would 
imply it isn't zipped when compiled and also that ample patch space is 
provided, as it is done in Qt5Core.dll for the qt_prfxpath property.)

Rgrds Henry

On 2016-01-28 10:47, Maximilian Hrabowski wrote:
> Hi,
> our application has an auto-update feature that allows to download and
> install a new version of the application. The update package includes
> everything, also Qt. The only permanent files are a launcher executable
> and a config file that points to the real application folder. The folder
> which contains the launcher is usually not writable by the user so the
> this application folder can be located anywhere on the system. The
> primary target platform is windows.
> Our application uses qt plugins, qt webengine etc. so we need to rely on
> a proper qt.conf file so any plugins and especially the
> QWebEngineProcess.exe is found.
> Since on Windows qt.conf is looked up in
> 1. :/qt/etc/qt.conf
> 2. applicationDirPath()+/qt.conf
> it is not found since the applicationDirPath() points to the folder of
> the launcher.
> What we need is a way to look up the qt.conf at another location as
> well. Of course i could patch Qt myself to do what i like but i target a
> solution that would qualify to become part of qt and i would be willing
> to contribute this feature.
> However, before do this i would like to discuss how this could be
> achieved and if there is any chance this feature could be accepted in qt.
> I thought about the following ways (order gives my personal opinion’s
> priority):
> 1. Add a new public API: static void QLibraryInfo::setQtConfFilePath(
> const QString& filePath) which defaults to ":/qt/etc/qt.conf“ and is
> used in QSettings*QLibraryInfoPrivate::findConfiguration() instead of
> the hard-coded path.
> 2. Also lookup qt.conf in all of QLibraryInfo::libraryPaths() (this is
> how we got the plugins found)
> 3. introduce an environment variable that points to the qt.conf similar
> to the one of QWebEngineProcess.exe
> Please comment.
> Cheers,
> Maximilian
> --
> Maximilian Hrabowski <hrabowski at clausmark.com
> <mailto:hrabowski at clausmark.com>>
> Clausmark GmbH
> Tel: +49 (721) 98963941
> Clausmark - The creators of BeeCore and Bee4IT
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

More information about the Development mailing list