Qt 整型和字符型的转换
Qt 整型和字符型的转换
文章目录
- Qt 整型和字符型的转换
- Qt Help
- 示例
- 结果
Qt Help
[static] QString QString::number(long n, int base = 10)
Returns a string equivalent of the number n according to the specified base.
The base is 10 by default and must be between 2 and 36. For bases other than 10, n is treated as an unsigned integer.
示例
long a = 63;
QString s = QString::number(a, 16); // s == "3f"
QString t = QString::number(a, 16).toUpper(); // t == "3F"
int b = 10;
QString b_string = QString::number(b); //b_string == "10";
还没有评论,来说两句吧...