qhexedit2 icon indicating copy to clipboard operation
qhexedit2 copied to clipboard

Sync the address passed in the signal `currentAddressChanged()` with the addressOffset?

Open bobhairgrove opened this issue 5 months ago • 3 comments

In the "example" application, the address in the status bar is the "real" address, regardless of whether there is an extra offset added. The address shown on the left of the address area shows the address plus the offset, as intended.

I think this can be easily fixed in qhexedit.cpp by changing the line where the signal is emitted:

229    emit currentAddressChanged(_bPosCurrent + _addressOffset);
                                                  ^^^^^^^^^^^^^^

Would this impact any other code? Or should the application handle this in its own slot connected to that signal?

bobhairgrove avatar Jul 22 '25 11:07 bobhairgrove

I am no longer convinced that it was a good idea to introduce this addressOffset in the first place. But since it is already there, the signal should report it accordingly.

I agree

Simsys avatar Oct 09 '25 09:10 Simsys

I am no longer convinced that it was a good idea to introduce this addressOffset in the first place.

It's actually quite useful in the scenario, for example, where some text file is being inspected because of encoding issues, and one wishes to display the hex content of just a single line at a time. The offset allows easily showing the offset of the beginning of the line relative to the original document.

In either case, the documentation should state what the actual behavior is.

bobhairgrove avatar Oct 26 '25 09:10 bobhairgrove

OTOH, perhaps it should all be left up to the client code and take out the addressOffset entirely? How much existing code would this impact?

bobhairgrove avatar Oct 26 '25 09:10 bobhairgrove