how can ı convert fron QString to hex ?
Printable View
how can ı convert fron QString to hex ?
by RTFM!
I mean, really! why not first look in the documentation?
Quote:
QString QString::arg ( int a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char( ' ' ) ) const
This function overloads arg().
The a argument is expressed in base base, which is 10 by default and must be between 2 and 36. For bases other than 10, a is treated as an unsigned integer.
fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar. A positive value produces right-aligned text; a negative value produces left-aligned text.
The '%' can be followed by an 'L', in which case the sequence is replaced with a localized representation of a. The conversion uses the default locale, set by QLocale::setDefault(). If no default locale was specified, the "C" locale is used. The 'L' flag is ignored if base is not 10.
Code:
QString str; .arg(63, 0, 16); // str == "Decimal 63 is 3f in hexadecimal" .arg(12345) .arg(12345) .arg(12345, 0, 16); // str == "12345 12,345 3039"