qhexedit2 icon indicating copy to clipboard operation
qhexedit2 copied to clipboard

dynamic bytesPerLine property depends on the widget size

Open firexx opened this issue 7 years ago • 5 comments

firexx avatar Jan 05 '17 10:01 firexx

To be honest, I don't like this idea. For me that is not useful.

Simsys avatar Jan 09 '17 20:01 Simsys

Why not, if it is a property. Default can be set as false. For some applications it can be very useful.

firexx avatar Jan 10 '17 08:01 firexx

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.

firexx avatar Jan 10 '17 09:01 firexx

I missed the chance to see some movement here.

Simsys avatar Mar 22 '19 11:03 Simsys

Simple and easy, thank you.

EvilGitty avatar Mar 23 '19 10:03 EvilGitty