Originally Posted by d_stranz No. A QByteArray is created empty with no size, so accessing text[ i ] on an empty array will cause a crash. Do this: Qt Code: Switch view QByteArray text64 = QByteArray::fromRawData( pointer_to_buffer, len_of_my_buffer ).toBase64();create_xml_function( text64, "encoded_data" ); // spaces not allowed in XML tags! QByteArray text64 = QByteArray::fromRawData( pointer_to_buffer, len_of_my_buffer ).toBase64(); create_xml_function( text64, "encoded_data" ); // spaces not allowed in XML tags! To copy to clipboard, switch view to plain text mode Of course, you will want to add some error checking... Thanks, it works now and I am passing it to my xml. you were right, my Qbytearray was "empty with no size"
QByteArray text64 = QByteArray::fromRawData( pointer_to_buffer, len_of_my_buffer ).toBase64();create_xml_function( text64, "encoded_data" ); // spaces not allowed in XML tags!
QByteArray text64 = QByteArray::fromRawData( pointer_to_buffer, len_of_my_buffer ).toBase64(); create_xml_function( text64, "encoded_data" ); // spaces not allowed in XML tags!
Forum Rules
Bookmarks