<QtVersion>

有关应用程序当前运行的 Qt 版本以及其编译所基于的 Qt 版本的信息。更多...

Header: #include <QtVersion>

函数

const char *qVersion()

宏

详细说明

函数文档

[noexcept] const char *qVersion()

在运行时以字符串形式返回 Qt 的版本号(例如,“6.1.2”)。这是运行时正在使用的 Qt 库的版本,未必与应用程序编译时使用的版本一致。

另请参阅 QT_VERSION_STR 和QLibraryInfo::version()。

宏文档

QT_VERSION_STR

该宏展开后会生成一个字符串,该字符串指定了 Qt 的版本号(例如,“6.1.2”)。这是编译应用程序时所使用的版本。该版本可能与应用程序在运行时实际使用的版本不同。

另请参阅 qVersion() 和QT_VERSION 。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.