2025年5月19日 星期一 乙巳(蛇)年 二月廿一 设为首页 加入收藏
rss
您当前的位置:首页 > 计算机 > 编程开发 > Qt

获取Qt的安装信息:包括安装目录及各种宏地址

时间:03-25来源:作者:点击数:76

可以通过qmake或QLibraryInfo类获取Qt的安装信息。

一、使用QMake

执行cmd 进入控制台页面,然后执行命令:

  • qmake -query

效果 如下:

在这里插入图片描述

二、使用QLibraryInfo

可以在程序中使用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
  • };
方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门