[Interest] Qt Sql BLOB data converting

Yauheni Pervenenka yauheni.pervenenka at viber.com
Mon Nov 28 08:46:49 CET 2022


Hello, community
I have faced with issue that qvariant using qstrlen for getting data size,
but sometimes it returns wrong size especially for BLOB data(if there are
some special symbols), are there any way to get data correct?

Note:
Database value 34, python returns correct data size, but
qvariant::toByteArray returns 52

Python data and Database data in hex(size
68): 763130492d46ab4c9c7bb0e9789b29c3ab1e4723dea6c8e5d2f9b266a275e1fbe4a6

Qt data in hex(size 104):
763130492d46c2ab4cc29c7bc2b0efbfbd78c29b29c3ab1e4723dea6efbfbdefbfbdefbfbdefbfbd66c2a275efbfbdefbfbdc4a6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20221128/2eb6801c/attachment.htm>


More information about the Interest mailing list