int cnt = 500; QByteArray ba; ba.append((char *)&cnt, sizeof(cnt)); QString temp = ba.toHex();
QString temp = QString("%1").arg(cnt, 8, 16, QChar('0'));
QFile file("out.txt"); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) return; QString temp = QString("%1").arg(cnt, 8, 16, QChar('0')); file.write(temp); file.close();