qhexedit2
qhexedit2 copied to clipboard
dynamic bytesPerLine property depends on the widget size
To be honest, I don't like this idea. For me that is not useful.
Why not, if it is a property. Default can be set as false. For some applications it can be very useful.
please look at the implementation
void QHexEdit::resizeEvent(QResizeEvent *) { if (_dynamicWidth){ int fixGaps = 0; if (_addressArea) fixGaps = addressWidth() * _pxCharWidth + _pxGapAdr; fixGaps += _pxGapAdrHex; if (_asciiArea) fixGaps += _pxGapHexAscii;
int charWidth = (width() - fixGaps) / _pxCharWidth;
setBytesPerLine(charWidth / (_asciiArea?4:3)); // 2 hex alfa-digits 1 space 1 ascii per byte = 4; if ascii is disabled then 3
} adjust(); }
i implemented it for test and it works. would you like to merge this changes then i can create a pull request.
I missed the chance to see some movement here.
Simple and easy, thank you.