Dax89 / QHexView

A versatile Hexadecimal widget for Qt5
MIT License
321 stars 102 forks source link

QHexview displays the extension #53

Closed neomissing closed 2 years ago

neomissing commented 3 years ago

At present, Qhexview displays a number by default at 8bit. Is it possible to support 16bit display a number and 32bit display a number? May I ask which interface can be modified to achieve this, 16bit 32bit

audetto commented 3 years ago

the key to display is

https://github.com/Dax89/QHexView/blob/master/document/qhexrenderer.cpp#L490

but, you really need to check everywhere you see a 3, you will have to replace with something, so that click, select and move work correctly.

Dax89 commented 3 years ago

Rendering code must be changed in order to support various display modes, currently is hardcoded to 8 bit visualization.

I'm thinking to rewrite the entire rendering part because is old and very complex, it can be simplified a lot

neomissing commented 3 years ago

OK, thank you, I will look at the overall code, looking forward to the update of the new rendering QHexview

Dax89 commented 2 years ago

Implemented in 5.0 branch: https://github.com/Dax89/QHexView/tree/5.0 This week I will merge it to master!

/* From QHexDocument... */
document->setGroupLength(4); // It will be rendered as '00000000 00000000'

/* ...or from the widget itself */
hexview->setGroupLength(2);   // It will be renderer as '0000 0000 0000 0000'