Are you sure you know what you are doing? QDataStream is a serialization mechanism, not a general purpose binary stream. If you insist on using it then simply reverse the direction of streaming operators (of course read to variables and then set them on the widgets).