Qt类型的限制在哪里? [英] Where are the limits for Qt types?
问题描述
定期地,我可以引用limits.h以查看某个类型的最大值,例如int或long。
Regularly, I could reference limits.h to see what the max is for a certain type, like an int or long.
在Qt中, qlonglong。有没有头文件和/或文档可以用类似的方式手动或以编程方式引用这些类型的限制?
In Qt, there are types like qlonglong. Is there a header file and/or documentation that can be used in a similar way to manually or programmatically reference the limits of these types?
推荐答案
很有可能Qt类型可以归结为定义 numeric_limits
的基本类型之一。您是否尝试过调用 std :: numeric_limits
?
There's a high likelihood the Qt types distill down to one of the basic types for which numeric_limits
are defined. Have you tried calling e.g., std::numeric_limits<qlonglong>::max()
?
out,如果类型不是内置 numeric_limits
,仍然可以专门为他们。如果是这种情况,人们希望Qt会包括他们。
As MSalters points out, too, if the types are not builtin numeric_limits
can still be specialized for them. If that were the case one would hope Qt would include them.
这篇关于Qt类型的限制在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!