I am wondering what the most efficient way would be to convert a binary that is saved as a QString into the corresponding Hex and save it in the same QString
Binary strings can be converted to hexadecimal strings trivially by considering that 4 bits are mapped straight to one hexadecimal digit. You have to work a bit if your string length is not multiple or 4, but it's not complicated to write something that processes that efficiently even working from left to right (to avoid prepending data to the target string or inverting it at the end).
@MatteoItalia That's good general advice. But then, most anything C-based will include selectable base when converting to integers from strings. So, strol() in C lets you select the base, C++ streams do, Qt's QString::toInt does, etc.
strol()in C lets you select the base, C++ streams do, Qt'sQString::toIntdoes, etc.