QLibraryInfo doesn't seem to load qt.conf

I installed Qt 4.7.2 and I am trying to use a class QLibraryInfo. My problem is that it QLibraryInfo::location(QLibraryInfo::PrefixPath)always returns C:\work3\qt-4.7-vs2010-x86which does not exist on my generation machine (should be C:\Qt\qt-4.7.2).

According to the documentation , I tried to create a file qt.confnext to my program, but the problem still remains. Here is its content:

[Paths]
Prefix=C:/Qt/qt-4.7.2/

At the moment, I used a symlink to work around the problem, but I would like to know if there is a suitable solution. Thank.

EDIT Here is a program using QLibraryInfo:

int main(int argc, char ** argv)
{
    QCoreApplication app(argc, argv); //< added after Piotr suggestion

    QFile outf("qtdirs.out");

    if (!outf.open(QIODevice::WriteOnly|QIODevice::Truncate|QIODevice::Text))
        return 1;

    QTextStream out(&outf);

    out << QLibraryInfo::location(QLibraryInfo::PrefixPath) << '\n';
    out << QLibraryInfo::location(QLibraryInfo::HeadersPath) << '\n';

...
}
+5
source share
1 answer

QCoreApplication, QLibraryInfo (QCoreApplication::applicationDirPath()), qt.conf. , qt.conf ":/qt/etc/qt.conf".

+2

All Articles