I am currently writing a simple Hex Viewer application in Qt 5+. I have almost everything together but I am really struggling with one last issue I could use some assistance on.
As It stands I have a main window with 3 subclassed QPlainTextEdit
widgets (to handle simultaneous scrolling of all 3) displayed in a row to the user. The first column is simply a line address indexing, second is the Hex view, third is the ASCII translation where Every character that is not in extended ASCII is replaced with a '.' (like most hex viewers). Everything I have is working as expected, but I have no idea where to go with the last feature I need.
When the user highlights Hex in the middle text edit, I want the ASCII that relates to it to be highlighted as well in the right text edit (and vice versa). I have no clear idea how to go about doing this last task.
Could someone please point me in the right direction and help me to figure this aspect out? One additional issue is I need to account for space in the hex view as it displays each line as
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
I'm sure that aspect is trivial after the first question is answered.