Qbytearray conversion to QString
Qbytearray byte;
QString string;
string = QString (byte);
Here we summarize the output of the two types:
Qdebug () << "print";
Qdebug () <<tr ("print");
Qdebug () <<ch; (ch is char type)
Qdebug () <<tr (CH);
Qdebug () <<byteArray; (ByteArray is Qbytearray type)
Qdebug () <<tr (ByteArray);
Qdebug () <<str; (str to qstring type)
But Qdebug () <<tr (str), it is not possible to use the TR () function to output the characters of the qstring type as follows:
Qdebug () <<tr (str.tolatin1);
int turn QString
int a=10;
QString b;
B=qstring::number (a)
QString ext. int
QString a= "120"
int b;
B=a.toint ()
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.