我有一个QString,我在其中附加了来自用户的数据输入。
在QString的末尾,我需要附加“ Normal” QString的十六进制表示形式。
例如:
QString Test("ff00112233440a0a");
QString Input("Words");
Test.append(Input);//but here is where Input needs to be the Hex representation of "Words"
//The resulting variable should be
//Test == "ff00112233440a0a576f726473";
我如何从ASCII(我认为)转换为十六进制表示形式?
谢谢你的时间。
您非常接近:
Test.append(QString::fromLatin1(Input.toLatin1().toHex()));
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句