可以通过qmake或QLibraryInfo类获取Qt的安装信息。
执行cmd 进入控制台页面,然后执行命令:
qmake -query
效果 如下:
可以在程序中使用QLibraryInfo类的location函数获取到Qt的安装信息。
QString QLibraryInfo::location(QLibraryInfo::LibraryLocation loc);
可使用的枚举参数:
enum LibraryLocation
{
PrefixPath = 0,
DocumentationPath,
HeadersPath,
LibrariesPath,
LibraryExecutablesPath,
BinariesPath,
PluginsPath,
ImportsPath,
Qml2ImportsPath,
ArchDataPath,
DataPath,
TranslationsPath,
ExamplesPath,
TestsPath,
#ifdef QT_BUILD_QMAKE
SysrootPath,
SysrootifyPrefixPath,
HostBinariesPath,
HostLibrariesPath,
HostDataPath,
TargetSpecPath,
HostSpecPath,
HostPrefixPath,
LastHostPath = HostPrefixPath,
#endif
SettingsPath = 100
};