[Development] Modify QLibraryInfo to support any default location of qt.conf
hrabowski at clausmark.com
Thu Jan 28 13:00:11 CET 2016
> Am 28.01.2016 um 11:54:02 schrieb Welbourne Edward <edward.welbourne at theqtcompany.com>:
> Maximilian Hrabowski (28 January 2016 10:47):
>> What we need is a way to look up the qt.conf at another location as well.
>> 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.
> How does this help in your scenario ?
> How would your launcher get to know what path to use ?
The launcher looks up the root path of the application bundle, loads the dll from there and then passes the path to a „package_main()“ function as parameter. So location is known in the dll and is use to setup library paths, etc. and would also be used to specify the qt.conf location inside the bundle directory.
>> 2. Also lookup qt.conf in all of QLibraryInfo::libraryPaths() (this is
>> how we got the plugins found)
> Potentially problematic if plugins might install a qt.conf that isn't
> what your application needs.
I have full control of the content of my application bundle and the libraryPath list is „cleaned up“ before instantiating QApplication to only contain paths into the bundle directory. So at least for me this could happen. Can you please give an example where this could cause trouble?
>> 3. introduce an environment variable that points to the qt.conf
>> similar to the one of QWebEngineProcess.exe
> Why isn't this first ?
> I would generally expect an environment variable to take precedence over
> all other configuration options except command-line options.
You are right, that an environment variable should be considered first. But I think one of the three possible solutions is enough. I did not mean to implement all three in this order. For me the environment variable is the solution that i like least.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4293 bytes
Desc: not available
More information about the Development