QTextStream and transactions
-
QDataStreamonly provides a convenient interface over the transaction, the actual transaction is handled by theQIODevicedirectly: https://doc.qt.io/qt-5/qiodevice.html#startTransaction
You are free to use transactions withQTextStreamyou just need a couple more lines of code.- instead of
dataStream.startTransaction()you would usetextStream.device()->startTransaction(); - instead of
if(dataStream.commitTransaction()){/*do stuff*/}you would use:
if(textStream.status() == QTextStream::Ok){ textStream.device()->commitTransaction(); /*do stuff*/ } else{ textStream.device()->rollbackTransaction(); } - instead of