我一直在尝试将<QtMath
> 添加到我的 Qt 中,以便我可以使用qDegreesToRadians
等,但是当我添加它时#include <QtMath>
,它说没有这样的文件或目录。
这是关于 QtMath 的 Qt 网站:
http://qt-project.org/doc/qt-5.1/qtcore/qtmath.html#details
我如何 QtMath,或者我做错了什么?
我在 5.1 中添加了这些功能,因此您无法在 5.0.2 中使用它们。请参阅每个相应部分中的文档说明:
此功能是在 QtCore 5.1 中引入的。
这是相应的 Gerrit 更改:
添加 qDegreesToRadians 和 qRadiansToDegrees 数学函数
但是#include <QtMath>
或者#include <QtCore/QtMath>
应该只是工作(一旦你更新,肯定),因为我添加的源代码中有这些行:
#if 0
#pragma qt_class(QtMath)
#endif