- qDebug如何打印QString?怎么打印QString?
1
2
3
4
5
6
7
8
9
10
11//method 1
qDebug("Hello World!!!");
//method 2
QString Content = "Hello World!!!";
qDebug()<<Content;
//method 3
QString Content = "Hello World!!!";
qDebug("%s", qPrintable(Content)); - QString与int相互转换方法
1
2
3
4
5
6
7//QString->int
QString a("123");
int b = a.toInt();
//int->QString
int c = 123;
QString d = QString::number(c);
QT如何转换各种奇葩到QString🤪
Author: Sheng Wang
Permalink: https://shengwang.fun/2023/01/30/qstring/
License: Copyright (c) 2019 CC-BY-NC-4.0 LICENSE