C++ (Qt)// Open cur tmpl file for reading only.QFile file(strFilePath);if(!file.open(QIODevice::WriteOnly)) throw tr("Can't open file %1\n%2") .arg(strFilePath) .arg(file.errorString()); // Set data stream.QDataStream out(&file);out.setByteOrder(QDataStream::LittleEndian); //Set endian.out.setVersion(QDataStream::Qt_5_4); //Set byte order.
C++ (Qt)out << m_strCommnets // The comment text......................out << other_obj1;out << other_obj2;
C++ (Qt)in >> m_strCommnets; // The comment text.