Dax89/QHexView

allow to view mmapped files

milianw opened this issue · 3 comments

please use mmap via https://doc.qt.io/qt-5/qfiledevice.html#map to open files, instead of copying the data into memory

Dax89 commented

It can be implemented as backend

Hi
I agree one can add a new implementation of QHexBuffer and handle this (and other cases), but these is one issue: the QHexDocument constructor is private, which means the only way to pass a custom QHexBuffer is via one of the templated fromXXX functions in QHexDocument.

So, if one had a really special QHexBuffer backed by some custom data structure that does not fit in one of the fromXXX function, he could still create it but would not be able to pass it to the QHexDocument.

Dax89 commented

I can add a generic QHexDocument::fromBuffer() function that accepts a generic QHexBuffer* instance and it takes the ownership.

(Or just make the constructor public)