What format is your input ?
and also what data type is compressed_string2 ? c_str() doesnt seem to be Qt function
What format is your input ?
and also what data type is compressed_string2 ? c_str() doesnt seem to be Qt function
My input is in a standard string format:
Qt Code:
std::string compressed_string2;To copy to clipboard, switch view to plain text mode
c_str converts a regular string to a QString.
Last edited by priceey; 23rd February 2009 at 15:59.
Hi,
Hi,
QString::QString ( const QByteArray & ba )
Constructs a string initialized with the byte array ba. The given byte array is converted to Unicode using fromAscii(). Stops copying at the first 0 character, otherwise copies the entire byte array.
So
stops at first '0' characterQt Code:
To copy to clipboard, switch view to plain text mode
Òscar Llarch i Galán
thanks for the input.
That makes sense.
but if that is the case, then if I add
#define QT_NO_CAST_FROM_ASCII
should add the complete line to the string?
is that true?
it gives the same result if I try it.
Hi,
I think that you have to add "48" to each char to obtain the desired character. Take a look at ASCII table where you can see that character "0" is 48 decimal. So this is basically a LUT.
Try it and tell if it helps you.
Òscar Llarch i Galán
thanks for all of your help
here is how I fixed it:
Qt Code:
To copy to clipboard, switch view to plain text mode
this seemed to fix the issue.
Bookmarks