Hi, I'm trying to write a QBitArray to file using a QDataStream but I think I may have the syntax wrong.
This is an example of how I'm doing it.
test1.resize(test1.size()+ 4);
test1.setBit(0, true);
test1.setBit(1, false);
test1.setBit(2, true);
test1.setBit(3, false);
QFile file ("testFile.data");
out << test1;
file.close();
QBitArray test1;
test1.resize(test1.size()+ 4);
test1.setBit(0, true);
test1.setBit(1, false);
test1.setBit(2, true);
test1.setBit(3, false);
QFile file ("testFile.data");
file.open(QIODevice::WriteOnly);
QDataStream out(&file);
out << test1;
file.close();
To copy to clipboard, switch view to plain text mode
Bookmarks