path: root/src/gui/doc/snippets/textdocument-listitemstyles
diff options
authorEirik Aavitsland <>2018-10-02 12:36:04 +0200
committerEirik Aavitsland <>2018-10-15 07:18:57 +0000
commitf2f040ae1c4fe48bff68bb45b2e20308fa895c50 (patch)
tree19818b75f10a14af8e8c5ce39d8af966f31a575b /src/gui/doc/snippets/textdocument-listitemstyles
parent0479379d2463ff44c54e774d41746fb1500cf481 (diff)
Improve support for QImages in QDataStream read transactions
QImage's operator>>(QDataStream&) did not set an error mode on the stream on read failures. That would break QDataStream transactions. Since the current QImage serialization cannot differentiate between truncated and corrupted data, we set the ReadPastEnd error as expected by the transaction system. Also specify the expected file format on decoding QImage from stream, to avoid all the format handlers' canRead() being invoked. This is necessary since some of them may call ungetChar(), which fails when the stream is in a transaction. Also add testing of this feature to the QDataStram transaction autotest. That required a slight rewrite of the fake sequential QIODevice subclass. The previous implementation had incorrect behavior of peek(), which is required by QImage decoders. Task-number: QTBUG-70875 Change-Id: If3f1ca7186ad1e6ca0e6e8ea81d2b2fbece6ea01 Reviewed-by: Alex Trotsenko <> Reviewed-by: Thiago Macieira <>
Diffstat (limited to 'src/gui/doc/snippets/textdocument-listitemstyles')
0 files changed, 0 insertions, 0 deletions