简体   繁体   中英

How to add/use <QtMath> with Qt 5.0.2

I have been trying to add <QtMath > to my Qt so I can use qDegreesToRadians and such but when I add #include <QtMath> it says no such file or directory.

Here's Qt's website about QtMath:

http://qt-project.org/doc/qt-5.1/qtcore/qtmath.html#details

How do I QtMath, or what have I done wrong?

I added these functions in 5.1, so you cannot use them in 5.0.2. See the documentation note about in each corresponding section:

This function was introduced in QtCore 5.1.

Here is the corresponding Gerrit change:

Add qDegreesToRadians and qRadiansToDegrees math functions

But #include <QtMath> or #include <QtCore/QtMath> should just work (once you update, for sure) because there are these lines in the source that I added:

#if 0
#pragma qt_class(QtMath)
#endif

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM