2024年3月4日星期一

Decimal to/from Octal by Qt QString

 quint32 oct_value = 20;

QString str_oct;


// from oct to dec

str_oct.setNum(oct_value);

quint32 dec_value = str_oct.toUInt(nullptr, 8);


// from dec to oct

str_oct.setNum(dec_value, 8);

oct_value = str_oct.toUInt();


沒有留言: